One of the requests a few people have asked
for is the ability to use strongly-typed expression syntax (instead of strings)
when referring to the Model when using a View's HTML and AJAX helper objects.
With the beta build of ASP.NET MVC this wasn't
possible, since the HtmlHelper and AjaxHelper helper classes didn't expose the
model type in their signature, and so people had to build helper methods
directly off of the ViewPage<TModel> base class in order to achieve
this.
The ASP.NET MVC RC build introduces new
HtmlHelper<TModel> and AjaxHelper<TModel> types that are exposed on
the ViewPage<TModel> base class. These types now allow anyone to
build strongly-typed HTML and AJAX helper extensions that use expression syntax
to refer to the View's model. For example:
Figure 27
The HTML form helper extension methods in the core ASP.NET
MVC V1 assembly still use the non-expression based string syntax. The
“MVC Futures” assembly released today (which works with the RC) has a few
initial implementations of expression-syntax based form helper
methods. We are going to iterate on these a bit longer and then
consider adding them into the ASP.NET MVC core assembly in the next
release.
You can of course also add your own helper methods (using
either strings or strongly-typed expressions). The built-in HTML/AJAX
helper methods can also optionally be removed (because they are extension
methods) if you want to replace or override them with your own