0

我的 LoginRrgister.chtml 页面中有 2 个表单,如下所示:

@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" />
}

那么这次如何在控制器中编写动作结果?

4

1 回答 1

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");
}
于 2013-08-17T11:21:09.450 回答