Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


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


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • Dodging the issue still

    by Francois Ward,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    WebForms are very powerful, and have many advantages over MVC, especially when it comes to building composite applications. However, they're much harder to use, and most people don't know how to use them properly, even ASP.NET veterans. The false first impression of ease of use because of the prototyping controls make things worse, because you can do something very quickly, but making a real app is significantly harder.

    In MVC, the best practices and guidances are given up front, the default template enforces it, and there's no pretence of "RAD" like there is in WebForm.

    If Microsoft wants to "fix" WebForm, they need to do the same thing: have a default MVP template like there was in the Web Application Software Factory, make the tutorials push to use the proper best practices (like avoiding to do real work in a button click even, instead opting to change model state, and have the UI modifications in pre-render), and then people will be able to benefit from the real power of WebForm without ending up in spaghetti code unless a real pro did it.

    Until then, unless you have absolute trust in the capacity of your team, you have to go with MVC: not because its necessarily better (even though often it is), but because you can't trust 90% of devs not to do something completely dumb with it because they followed the mainstream tutorials.

  • they need more ..

    by serge ----,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    they need to bring over mvc tempdata scope (otherwise known as flash scope in other platforms) and something akin to JSF's conversation scope.

  • Re: they need more ..

    by George Jiang,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    and JSF's managed bean model
    and JSF2's very simple yet very usefule ajax suprot
    and ...

    No! WebForm is only good for RAD and too complicated for anything else more properly architected. Just as they created MVC out of lessons from Java and Ruby, MS needs to create another framework by leanring lessons from Java frameworks such as JSF2/RichFaces4, GWT etc.

    Just my 2c.

  • Re: Dodging the issue still

    by Jonathan Allen,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    I find your view point to be very interesting. I've had the exact opposite impression. WebForms are for quick, slap together sites and MVC were for the ones that required proper planning and a skilled team.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p