View
@using (Html.BeginForm())
{
<input name= "number1" /><br />
<input type="submit"/>
}
Contoller
[HttpPost]
public ActionResult GetNumber(int number1)
{
}
works fine whereas the following code
View
@using (Html.BeginForm("SomeAction","SomeContoller"))
{
<input name= "number1" /><br />
<input type="submit"/>
}
Controller
[HttpPost]
public ActionResult SomeAction(int number1)
{
}
is not working. I tried without the parameter its working then, but i am not able to get the value for number1 to this contoller. How would I do that?.
Thanks for your answer :)
Try this: