Html.BeginForm("LogOn", "Home", FormMethod.Post)
LogOn – Action.
Home – Controller.
So It will create the Url like = Home/LogOn .
But If I have action LogOn(String s ) , LogOn(int i) inside the controller Home and both are HttpPost ,
Then which one action raise at that time . means right now it is giving exception :
"ambiguous between the
following action methods"
You cannot have 2 actions with the same name inside the same controller. The only way for this to work is to make one of the 2 actions accessible only with
[HttpPost]:Now when you submit the form it will invoke the second action. And when you type
/home/logonin your browser address bar (using GET verb) it will execute the first action to probably render the LogOn form.