I have this code in mvc 3 razor
@using (Html.BeginForm("MyAction", "MyController"))
{
<input type="text" id="txt" name="txt"/>
<input type="image" src="image.gif" alt="" />
}
in controller I have this code
[HttpPost]
public ActionResult MyAction(string text)
{
//TODO something with text and return value...
}
now, how to send a new value, for exemple id to Action result??? Thanks
You use a view model:
and then pass this view model to the view:
and then the view is strongly typed to this model: