title: asp.net core mvc application form post with query string parameters
body: <p>I am building a login form in .net core mvc. Below is my login form </p>
  
  <pre><code>&lt;form class="c-form" asp-controller="Account"
    asp-action="Login"&gt;
  &lt;div class="form-group"&gt;
      @Html.TextBoxFor(m =&gt; m.Username, new { @class = "form-control c-input", placeholder = "Username" })
  &lt;/div&gt;
  
  &lt;div class="form-group"&gt;
      @Html.PasswordFor(m =&gt; m.Password, new { @class = "form-control c-input", placeholder = "Password" })
  &lt;/div&gt;
  &lt;div class="help-text help-text-error"&gt;
      @Html.ValidationMessage("UserNamePasswordInvalid")
  &lt;/div&gt;
  &lt;div class=""&gt;
      &lt;button type="submit" class="btn-c btn-teal login-btn width100"&gt;Login&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>If a form is posted with incorrect credentials user stays on the page with validation failure messages. </p>
  
  <p>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. </p>