I have the feeling that I am also “web forms” with this, but I will ask anyway. I have a form in an ASP.NET MVC project with several input fields and two buttons. One button is used to filter one of the lists. Another is used to submit the form. My view looks something like this:
<%using (Html.BeginForm())
{%>
<%=Html.TextBox("SearchItems") %>
<input type="submit" name="Command" value="Find" />
<%=Html.ListBox("SelectedItems", new MultiSelectList(model.AvailableItems,"Id", "Name", model.SelectedItems))%>
<input type="submit" name="Command" value="Send" />
<%} %>
My actions look something like this:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Index([Bind(Prefix = "")]SendMessageRequest model)
{
if (model.Command == "Find")
return SearchItems(model);
if (model.Command == "Send")
return Send(model);
throw new Exception("Invalid command.");
}
- , . , . , . , → , . Pocket IE, , -, Pocket IE - - Command, .
Pocket IE, , JavaScript. Ajax , onClick.
, , MVC-? , - ?