看法
@using (Html.BeginForm())
{
<input name= "number1" /><br />
<input type="submit"/>
}
控制器
[HttpPost]
public ActionResult GetNumber(int number1)
{
}
工作正常,而以下代码
看法
@using (Html.BeginForm("SomeAction","SomeContoller"))
{
<input name= "number1" /><br />
<input type="submit"/>
}
控制器
[HttpPost]
public ActionResult SomeAction(int number1)
{
}
不管用。我在没有参数的情况下尝试了它的工作,但我无法将 number1 的值传递给这个控制器。我该怎么做?
感谢您的回答 :)