BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News MVC Features Rumored to be Coming to ASP.NET WebForms

MVC Features Rumored to be Coming to ASP.NET WebForms

This item in japanese

Despite the excitement around MVC, ASP.NET WebForms are still very popular. According to Evonet Consulting, the next major ASP.NET release will contain a number of features originally introduced in MVC, including Model Binders, unobtrusive client-side validation, and CSS sprites.

MVC Model Binders automatically handle the mapping between fields on a web form and properties on an object. This avoids a lot of the repetitive code that exists in WebForms where properties from an object are manually mapped to controls for presentation to the user and then mapped back out again to the object in order to save changes. For an example of Model Binders in action see Maarten Balliauw’s presentation. The next version of ASP.NET will allow data controls like the Gridview or Listview to directly bind updated values to the underlying record. Hopefully records represented by a variety of controls, such as a number of text boxes, will also acquire some level of automatic binding.

MVC handles client-side validation using jquery.validate and HTML 5 data-custom attributes. The next version of ASP.NET will also include this. This avoids the tedious and bulky JavaScript writing that was previously required in order to handle client-side validation. HTML 5 data custom attributes allow you to store information in HTML elements as attributes prefaced with ‘data’. This gives you lots of flexibility with respect to how information is stored in the DOM, while making it easy to distinguish between data custom attributes and standard HTML attributes from JavaScript or server-side code. For an example of how this Jquery validation could work, take a look at this jquery validation plug-in. This plug-in includes automatic e-mail and URL validation as well as a many other automatic rules for how a field will be validated.

CSS sprites are an optimization in how to push images down to the client. All images on the page are combined into a single file laid out in a grid. This significantly reduces the number of HTTP requests required to get all the images on the page, thus speeding up load time. CSS sprites are coming in the next version of ASP.NET WebForms, but if you don't want to wait you can get the CSS spirits preview from CodePlex.

Rate this Article

Adoption
Style

BT