search

Home  >  Q&A  >  body text

Windows - How to call mysql after asp.net is connected? For example, how to implement the following login verification function?

The database table only has two columns: username and password.

<form id="form1" runat="server">
<p class="biaodan">
        用户名:<asp:TextBox ID="use" runat="server" onKeyUp="value=value.replace(/[\W]/g,'')" MaxLength="12" OnTextChanged="use_TextChanged"></asp:TextBox>
        <br />
        密&nbsp;&nbsp;&nbsp; 码:<asp:TextBox ID="pwd" runat="server" onKeyUp="value=value.replace(/[\W]/g,'')" MaxLength="12" OnTextChanged="pwd_TextChanged"></asp:TextBox>
        <br />
        验证码:
        <%--<span id="code" class="nocode">验证码</span> <input type="text" class="input" />  --%>
        <input type="text"  id="inputCode" />
        <br/><p class="code" id="checkCode" onclick="createCode()" ></p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onclick="createCode()">换一张</a>
        <br/>
        <asp:Button ID="check" runat="server" Text="登录" Width="100px" OnClick="btn_login_Click" />
    </p>
</form>
迷茫迷茫2814 days ago715

reply all(1)I'll reply

  • PHPz

    PHPz2017-06-06 09:54:04

    In the .cs file corresponding to the page, there is a btn_login_Click method. In this method, the user name and password are obtained, and the database is checked to see if there is corresponding data.

    reply
    0
  • Cancelreply