新手問題:請問我在一個頁面添加了兩個form,第一個form是登錄,使用了runat="server",點擊注冊按鈕會彈出第二個form注冊資訊,我想在后臺寫注冊按鈕的點擊函式用來獲取資訊,插入資料庫,可是第二個form加不了runat="server"不能在后臺寫函式了該怎么辦
<body>
<form id="form1" runat="server" class="login-box">
<h1>資訊管理系統</h1>
<div class="textbox">
<%--添加圖示--%>
<i aria-hidden="true"></i>
<input type="text" placeholder="Enter Email" name="username" />
</div>
<div class="textbox">
<input type="password" placeholder="Enter Password" name="password"/>
</div>
<asp:Button ID="Button1" runat="server" Text="Login" class="btn "
onclick="Button1_Click1" />
<button onclick="document.getElementById('id01').style.display='block'" type="button" class="btn ">Register</button>
</form>
<div id="id01" class="modal">
<span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">×</span>
<form class="modal-content animate" action="">
<div class="container">
<h1 align="center">REGISTER</h1>
<label><b>Email</b></label>
<input type="text" placeholder="Enter Email" name="email" required>
<label><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required>
<label><b>Repeat Password</b></label>
<input type="password" placeholder="Repeat Password" name="psw-repeat" required>
<input type="checkbox" checked="checked"> Remember me
<div class="clearfix">
<button type="button" onclick="document.getElementById('id01').style.display='none'" class="cancelbtn">Cancel</button>
<button type="submit" class="signupbtn" >Sign Up</button>
</div>
</div>
</form>
</div>
</body>
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/266159.html
標籤:ASP.NET
