I watched Damien Edward’s excellent presentation and learned about the new features that will be available to us in the vNext of ASP.NET Webforms, if you like to get the full details I encourage you to watch the video. Here I have summarized the main features.
Strongly typed Data control and Model Binding support
Using these you will be able to bind strongly typed models to your datacontrols and get full intellisense for them.
![Image(31)[5] Image(31)[5]](http://zubairahmed.net/wp-content/uploads/2011/06/Image315_thumb.png)
![Image(1)[5] Image(1)[5]](http://zubairahmed.net/wp-content/uploads/2011/06/Image15_thumb.png)
You can also tell the controls to get their data from a method
![Image(32)[4] Image(32)[4]](http://zubairahmed.net/wp-content/uploads/2011/06/Image324_thumb.png)
In your codebehind file you define your method like this, this works great with Entity Framework 4.1
![Image(3)[4] Image(3)[4]](http://zubairahmed.net/wp-content/uploads/2011/06/Image34_thumb.png)
Add Querystring value with method parameter
Another improvement that is coming up is the support of attributes in method arguments as in the following code.
It is looking under the querystring collection for the key minProductsCount, converting it to an integer if found or leaving null because it is nullable, saving a lot lines of code that we write today.
![Image(4)[4] Image(4)[4]](http://zubairahmed.net/wp-content/uploads/2011/06/Image44_thumb.png)
![Image(5)[4] Image(5)[4]](http://zubairahmed.net/wp-content/uploads/2011/06/Image54_thumb.png)
Take the above value from a control and other collections
There will be support for other attributes as well, suppose you want to get the value from a control of the same name, a Form Collection, Cookie, ViewState even from your custom attribute and so on
Change parameter id
By default it uses the parameter name but if your control’s id is different then your parameter name, you can specify the id like this
![Image(11)[4] Image(11)[4]](http://zubairahmed.net/wp-content/uploads/2011/06/Image114_thumb.png)
Master/Detail scenario in GridView
Have another grid view bound to the master gridview, define the select method on the detail gridview, then tell the method to pull the selected id from the master gridview
![Image(15)[4] Image(15)[4]](http://zubairahmed.net/wp-content/uploads/2011/06/Image154_thumb.png)
![Image(16)[4] Image(16)[4]](http://zubairahmed.net/wp-content/uploads/2011/06/Image164_thumb.png)
The results look like this
![Image(17)[4] Image(17)[4]](http://zubairahmed.net/wp-content/uploads/2011/06/Image174_thumb.png)
Update support
![Image(18)[4] Image(18)[4]](http://zubairahmed.net/wp-content/uploads/2011/06/Image184_thumb.png)
![Image(33)[4] Image(33)[4]](http://zubairahmed.net/wp-content/uploads/2011/06/Image334_thumb.png)
Because there is no info of the Product from the gridview due to the databinding expressions, the Products property is null so instead of binding Product info to the gridview and getting it back on postback, we’ll have the following method
TryUpdateModel(category)
Now the product collection still exists, just update this model with the info from the gridview and save
![Image(20)[4] Image(20)[4]](http://zubairahmed.net/wp-content/uploads/2011/06/Image204_thumb.png)
Adding Validation using Data Annotations
Save only if the model is in valid state or reload the category
![Image(23)[4] Image(23)[4]](http://zubairahmed.net/wp-content/uploads/2011/06/Image234_thumb.png)
Adding custom model exception on Db.SaveChanges();
For example if you have a unique key constraint on your table then you will push the exception from Entity Framework into the Model state to be able to show the error on page in gridview, like this.
![Image(24)[4] Image(24)[4]](http://zubairahmed.net/wp-content/uploads/2011/06/Image244_thumb.png)
![Image(25)[4] Image(25)[4]](http://zubairahmed.net/wp-content/uploads/2011/06/Image254_thumb.png)
Support to bind the Gridview to Dynamic is coming up
![Image(26)[4] Image(26)[4]](http://zubairahmed.net/wp-content/uploads/2011/06/Image264_thumb.png)
Async in WebForms vNext
New methods and keywords are coming up for improving asynchronous communications
![Image(28)[4] Image(28)[4]](http://zubairahmed.net/wp-content/uploads/2011/06/Image284_thumb.png)
The call will return immediately and the results will be filled in later
Chaining three async method calls together then returning the results, using PageAsyncTask
![Image(29)[4] Image(29)[4]](http://zubairahmed.net/wp-content/uploads/2011/06/Image294_thumb.png)
The result of those three files loaded looks like this
![Image(30)[4] Image(30)[4]](http://zubairahmed.net/wp-content/uploads/2011/06/Image304_thumb.png)
There’s more
Unobtrusive built in validators – no inline javascript, AntiXSS Encoding, Html5 updates and runtime combination and minification of Javascript and Css files is coming up
Summary
- Webform is not dead
- Improved data binding via Strongly typed data controls and model binders
- Easier Async programming coming to ASP.NET
..and much more