,,The MVC platform: more form extension methods

I’ve already talked about several method extensions helpers for injecting forms in a page. However, the latest release has introduce a couple more methods for doing that and I’ve thought I’d write a quick post on those new methods.

Basically, you’ll have several overloads named BeginRouteForm which let you set the form’s action method from a specific route. As you’d expect, you use it the same way you use the “Old” BeginForm method (check this post to get more info on what I mean). Here’s a quick example of what I mean:

<% using( var frm = Html.BeginRouteForm("DefaultRoute")) {%>
…//control definition

In the previous example, I’m using the simplest of the overloads: it only takes the name of the route that you want to use to build the form’s action url. As I’ve said, there are others (too much to put here so I’ll just redirect you to the FormExtension.cs file.


~ by Luis Abreu on January 31, 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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: