Ive just started to play around with ASP MVC and I come from a background of Web Forms. Ive started a MVC internet application and wanted to know how a button calls an action from a controller. Here I would like to use the log in example that is provided with an MVC Internet application.
AccountController:
Lots of methods
Login View:
@using (Html.BeginForm(new { ReturnUrl = ViewBag.ReturnUrl })) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>Log in Form</legend>
<ol>
<li>
@Html.LabelFor(m => m.UserName)
@Html.TextBoxFor(m => m.UserName)
@Html.ValidationMessageFor(m => m.UserName)
</li>
<li>
@Html.LabelFor(m => m.Password)
@Html.PasswordFor(m => m.Password)
@Html.ValidationMessageFor(m => m.Password)
</li>
<li>
@Html.CheckBoxFor(m => m.RememberMe)
@Html.LabelFor(m => m.RememberMe, new { @class = "checkbox" })
</li>
</ol>
<input type="submit" value="Log in" />
</fieldset>
so when I hit the sumbit button on the view, which method in the AccountController class will be called? and how do you work it out?
Thanks all :)