我有一个网页,其中包含一个注册表单和一个登录表单,用户可以在其中注册或登录。
我的问题是当我尝试在登录文本框上注册验证时,停止请求进入服务器。此外,当我从该页面登录时,注册表单控件上的验证控件停止请求进入服务器。我应该尝试什么?
我曾尝试使用更新面板,但这不起作用。
这是我的代码:
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table width="400px" style="height:30px">
<tr>
<td class="style3" colspan="2">
<div class="register-bg">
<div class="padl20 padt5">
<span style="color:#2D432C">Registration Here</span>
</div>
</div>
</td>
</tr>
</table>
<table id="hpreg" style="height:380px; width: 358px;">
<tr >
<td style="width: 159px">
<b>Full Name</b>
</td>
<td style="width: 187px" class="wdth180">
<asp:TextBox ID="txt_nam" runat="server" Width="170px" CssClass="textfield"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txt_nam" ErrorMessage="Please enter Name" ForeColor="Red">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td style="width: 159px">
<b> Father Name</b>
</td>
<td class="wdth180" style="width: 187px">
<asp:TextBox ID="txt_fnam" runat="server" Width="170px"
CssClass="textfield"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="txt_fnam" ErrorMessage="Please enter father name"
ForeColor="Red">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td style="width: 159px">
<b> Gender</b>
</td>
<td class="wdth180" style="width: 187px">
<asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatColumns="2"
ToolTip="Enter Your Gender" Width="160px" CssClass="radio wdth130">
<asp:ListItem Value="M">Male</asp:ListItem>
<asp:ListItem Value="F">Female</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
......
在同一页面上登录 html 是这样的:
<asp:Content ID="Content2" runat="server"
contentplaceholderid="ContentPlaceHolder2">
<table width="240px" >
<tr style="height:28px;">
<td>
<b><asp:TextBox runat="server" ID="TextBox1" CssClass="textfield"/></b>
</td>
<td>
<asp:TextBox runat="server" ID="TextBox2" TextMode="Password" CssClass="textfield" />
</td>
</tr>
<tr style="height:28px;">
<td><asp:LinkButton ID="LinkButton1" runat="server">Forget Password</asp:LinkButton>
</td>
<td> <asp:Button ID="btn_login" CssClass="medimum-btn wdth45" runat="server" Text="Login" onclick="btn_login_Click" />
</td>
</tr>
<tr style="height:28px;">
<td></td>
<td></td>
</tr>
</table>
<div class="fleft">
</div>
<br />
<div class="fleft padl5">
</div>
<div class="fleft padl5">
<br />
</div>
</asp:Content>