【发布时间】:2014-01-20 18:30:01
【问题描述】:
当我尝试发布表单时,控制器中的方法参数为空。那么代码有什么问题呢?
index.cshtml
@using (Html.BeginForm("Index", "Settings", FormMethod.Post, new { id = "test1" }))
{
<input type="submit" name="SaveButton" value="Save" />
}
设置控制器-
[HttpPost]
public ActionResult Index(string id)
{
return View();
}
【问题讨论】:
标签: asp.net-mvc asp.net-mvc-4 view parameters controller