The MVC framework: more on the future’s helpers

Ok, so in the previous posts I kept talking about some of the helpers available on the future assembly. In this short post we’re going to complement that information with some more methods that let you expressions for specifying form actions (yes, this can be seen as form extensions, part III).

The future assembly introduces 2 new extension methods with these signatures:

public static MvcForm BeginForm<TController>(this HtmlHelper helper, Expression<Action<TController>> action) where TController : Controller

public static MvcForm BeginForm<TController>(this HtmlHelper helper, Expression<Action<TController>> action, FormMethod method) where TController : Controller

As you can see, they’re really similar to the ones we have on the MVC assembly; the main difference, is that we’re using Lambdas for setting up the action that ends up deciding the url for the form’s submission. The use of this method follows the same approach we’ve seen for the button helper methods. And that’s it. There’s still more to come. Stay tuned!

Advertisements

~ by Luis Abreu on March 22, 2009.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: