我在Login register.html页面中有两个表单,如下所示:
@using (Html.BeginForm("Tests1", "Test", FormMethod.Post,
new { id = "FormSearch1" }))
{
<input type ="submit" value="Filter1 " id="submit" />
}
和另一种形式如下:
@using (Html.BeginForm("Tests2", "Test", FormMethod.Post,
new { id = "FormSearch2" }))
{
<input type ="submit" value="Filter2 " id="save" />
}
所以这次如何在控制器中写入动作结果?
答案 0 :(得分:0)
[HttpPost]
public ActionResult Test1()
{
ViewBag.Message = "Your app description page.";
return View("sameViewForBoth");
}
[HttpPost]
public ActionResult Test2()
{
ViewBag.Message = "Your app description page.";
return View("sameViewForBoth");
}