Forums - C# Corner

Forum guidelines
Sushant Torankar

Sushant Torankar

  • 1.7k
  • 119
  • 809

About MVC Login

Mar 15 2019 6:35 AM
Hello Everyone,
 
I am creating a simple login page with form submit action. But I want to display loading image when clicked on the Login button.
 
I did it in other pages inside Ajax Javascript functions. But this login page is based on form submit action. So there is a javascript function where I can write this code.
 
Please find the code below :
 
@using (Html.BeginForm("Login", "Account", FormMethod.Post, new { @id = "LoginForm", returnurl = ViewBag.returnurl }))
{
<div class="login-input-content">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="material-icons">person</i></span>
</div>
<input type="email" class="form-control" placeholder="Email Address" aria-label="Username">
</div>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="material-icons">lock</i></span>
</div>
<input type="password" class="form-control" placeholder="Password" aria-label="Username">
</div>
</div>
<div class="row mx-0 justify-content-end no-gutters">
<div class="col-6">
<button class="btn btn-block gradient border-0 z-3" type="submit" id="btnLogin">Sign in</button>
</div>
</div>
}
 
Thanks in advance

Answers (3)