The MVC platform: more form extension methods

Published Sat, Jan 31 2009 13:43

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.

Filed under: ,

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above:  

Search

This Blog

Tags

Community

Archives

Syndication

Email Notifications

News




  • View Luis Abreu's profile on LinkedIn


    Follow me at Twitter

    My books

    Silverlight 4.0: Curso Completo

    ASP.NET 4.0: Curso Completo

    Portuguese LINQ book cover

    Portuguese ASP.NET 3.5 book cover

    Portuguese ASP.NET AJAX book cover

    Portuguese ASP.NET AJAX book cover