ASP.NET MVC 2 - Setting id of Html.Form

Posted by Justin on Stack Overflow See other posts from Stack Overflow or by Justin
Published on 2010-06-12T17:48:30Z Indexed on 2010/06/12 17:52 UTC
Read the original article Hit count: 286

Filed under:
|

Hey,

How do you set the id of an Html.Form in ASP.NET MVC 2?

I tried this:

<% using (Html.BeginForm("Save", "Clients", new { id = "SubmitForm" })) {%>

But it doesn't work, my form still doesn't have an id property:

<form action="/TothSolutions/Secure/Clients/Save/SubmitForm" method="post"> 

I'm guessing this worked in ASP.NET MVC 1 but not 2. The reason I need the id property set is so that I can do jQuery validation on the form: $("#myForm").validate etc...

Thanks, Justin

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-mvc-2