单击重置按钮时怎么先触发验证控件啊
单击重置按钮时为什么会先触发验证控件啊 而不是直接清除内容重置啊 大侠帮我看看前台代码:
<td align="right" class="style5">
用户名:</td>
<td align="left">
<asp:TextBox ID="tb_name" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="tb_name" ErrorMessage="用户名不能为空!"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right" class="style5">
用户密码:</td>
<td align="left">
<asp:TextBox ID="tb_pwd" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="tb_pwd" ErrorMessage="密码不能为空"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right" class="style5">
确认密码:</td>
<td align="left">
<asp:TextBox ID="tb_pwdsure" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
ControlToValidate="tb_pwdsure" ErrorMessage="**"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator1" runat="server"
ControlToCompare="tb_pwd" ControlToValidate="tb_pwdsure" ErrorMessage="密码不一致"></asp:CompareValidator>
</td>
</tr>
<tr>
<td align="right" class="style5">
真实姓名: </td>
<td align="left">
<asp:TextBox ID="tb_tname" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right" class="style5">
Email: </td>
<td align="left">
<asp:TextBox ID="tb_email" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
ControlToValidate="tb_email" ErrorMessage="Email不能为空"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="tb_email" ErrorMessage="*"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td align="right" class="style5">
性别:</td>
<td align="left">
<asp:RadioButtonList ID="Rblsit" runat="server" RepeatDirection="Horizontal"
Width="92px">
<asp:ListItem Selected="True">男</asp:ListItem>
<asp:ListItem>女</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr>
<td align="right" class="style5">
出生日期:</td>
<td align="left">
<asp:TextBox ID="tb_bth" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right" class="style5">
电话号码:</td>
<td align="center" class="style8">
<asp:Button ID="tb_tjiao" runat="server" Text="提交" onclick="tb_tjiao_Click" />
<asp:Button ID="tb_reset" runat="server" Text="重置" UseSubmitBehavior="False"
onclick="tb_reset_Click" />
</td>
后台代码:
protected void tb_reset_Click(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
tb_email.Text = "";
tb_name.Text = "";
tb_pwd.Text = "";
tb_bth.Text = "";
tb_phone.Text = "";
tb_pwdsure.Text = "";
tb_tname.Text = "";
}
}