Vote count:
0
Here's the template's HTML form :
<form class="form-login" action="index.html">
<h2 class="form-login-heading">sign in now</h2>
<div class="login-wrap">
<input type="text" class="form-control" placeholder="User ID" autofocus="autofocus">
<br>
<input type="password" class="form-control" placeholder="Password">
<label class="checkbox">
<span class="pull-right">
<a data-toggle="modal" href="login.html#myModal"> Forgot Password?</a>
</span>
</label>
<button class="btn btn-theme btn-block" href="index.html" type="submit"><i class="fa fa-lock"></i> SIGN IN</button>
Here's my modification to it :
<form id="form1" runat="server" class="form-login" method="post" action="HomeDoc.aspx">
<div>
<h2 class="form-login-heading">sign in now</h2>
<div class="login-wrap">
<input type="text" class="form-control" placeholder="User ID" id="userid" runat="server" autofocus="autofocus"/>
<br/>
<input type="password" class="form-control" placeholder="Password" id="password" runat="server" />
<label class="checkbox">
<span class="pull-right">
<a data-toggle="modal" href="StaffLogin.aspx#myModal"> Forgot Password?</a>
</span>
</label>
<button class="btn btn-theme btn-block" runat="server" type="submit"><i class="fa fa-lock"></i> SIGN IN</button>
What i want to do is compare the values of the 2 inputs here with the values in my SQLServer db using c#. So far, the page i intend to redirect the user to is being loaded every time i click the submit button, irrespective of the userid/password.
Also, i know the c# code for setting up connection and comparing values with db for web forms. So, what specific changes to bring to that code for html form inputs?
Please help. Thanks.
asked 1 min ago
How to compare database values with inputs through html form using c#
Aucun commentaire:
Enregistrer un commentaire