O'Reilly logo

.NET Framework 4.5 Expert Programming Cookbook by A.P. Rajshekhar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Binding objects to controls using strongly-typed data controls

In the previous versions of ASP.NET, to bind a property of an object to a control we needed to use Eval. Eval makes use of reflection to check whether the property is present in the data bound to the control or not. If the property is present, the value of the property is retrieved and displayed. The main problem with Eval is that checking for the property name is not done at compile time.

ASP.NET 4.5 introduces strongly-typed controls. The main property of these controls is that we can declare the data type of the object that the controls are bound to. In this recipe we will use some of these strongly-typed data controls to display the data entered by the user in the registration page. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required