Passing parameters in MVC

Posted by Avinash on Stack Overflow See other posts from Stack Overflow or by Avinash
Published on 2009-03-12T05:50:34Z Indexed on 2010/05/31 2:32 UTC
Read the original article Hit count: 274

Filed under:
|

Thare is two forms in a page first one for searching and another for deleting....

<table><tr><td>
<% using(Html.BeginForm("ViewList","ControllerName",
[values],FormMethod.Post,new{id="viewListForm"}))
{ %>
    Name:    <%=Html.TextBox("Name", "[value]", new { maxlength = "250" })%>
    Location: <%=Html.TextBox("Location", "[Value]", new { maxlength = "250" })%>
    <input type="submit" id="Search" name="Search" value="Search" />

<% } %>
</td></tr>
<tr><td>
<% using(Html.BeginForm("DeleteList","ControllerName",
         new { name=?,location=? },[values],FormMethod.Post,
          new{id="deleteListForm"}))
{ %>
   [here the code for all items displayed in a table.]

  <input type="submit" id="Delete" name="Delete" value="Delete" />

When delete buttom pressed i need to pass two parameters ie name
and location. The values of name and location are in the above viewListForm.
How i take this value from the viewListForm at run time ?

<% } %>
</td></tr><table>

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about parameters