I have the following simple Login-View:(only posted the relevant parts)
@model Models.LoginModel
@using (@Html.BeginForm("Login", "Account", FormMethod.Post, new { @enctype = "multipart/form-data", @class = "fm", @ReturnUrl = @ViewBag.ReturnUrl }))
{
@Html.AntiForgeryToken()
<h1 id="title-header">Login</h1>
<div>
@Html.TextBoxFor(m => m.Username, new { @maxlength = "250", @class = "username", @style = "width: 250px;" })
@Html.ValidationMessageFor(m => m.Username)
</div>
<div>
@Html.PasswordFor(m => m.Password, new { @maxlength = "250", @class = "password", @style = "width: 250px;" })
@Html.ValidationMessageFor(m => m.Password)
</div>
<div>
<input type="submit" value="Login" />
@Html.ActionLink("Reset PW","ResetPw","Account", new { model=Model})
</div>
</div>
}
When I submit the form everything is fine: The Login-Action is called and the Model contains username and password.
When I click onto the "Reset PW" - Link I want to achieve the same but with a different action. The action is called as wanted ("ResetPw()"), but the model does not contain the username entered by the user, but each string property of the model is null.