c# - Implementing Forms in ASP.net MVC -


I have a simple form on a watch page, which has been implemented as user control, something like that Looks:

  <% = html.BeginForm ("list", "building", formMethod.Post)%> // Multiple fields go here & lt;% Html.EndForm (); & Gt%;  

There are two problems that I would like to solve, the first is that I like the controlling method which it gets to take the parameters of user control type. The goal of this method is to avoid putting all the fields in the parameter list. The controller method currently looks like this:

The remaining fields in this form will be used to search for the type of buildings.

The form is okay, I can search on the capability of the way you would expect, but when I add the parameter for search I can smell further the frustration. Secondly, the small problem is that since the page provides "string" System.Web.mvc to BeginForm tag, go to the form "page how can I remove it?

1) Use form collection as argument:

<

You can now repeat the formclass You can get the key / value search term from your search form.

2) Remove "=" from the BeginForm:

   < / Code> 

He said, using you, Umm ...

  using  <%}%>  

Comments