I am building a login form in .net core mvc. Below is my login form
<form class="c-form" asp-controller="Account"
asp-action="Login">
<div class="form-group">
@Html.TextBoxFor(m => m.Username, new { @class = "form-control c-input", placeholder = "Username" })
</div>
<div class="form-group">
@Html.PasswordFor(m => m.Password, new { @class = "form-control c-input", placeholder = "Password" })
</div>
<div class="help-text help-text-error">
@Html.ValidationMessage("UserNamePasswordInvalid")
</div>
<div class="">
<button type="submit" class="btn-c btn-teal login-btn width100">Login</button>
</div>
If a form is posted with incorrect credentials user stays on the page with validation failure messages.
Login page also has return url in query string, when the form is posted query string parameters are lost. What is the correct way of doing form post in .net core.