我想重新设置形式,但我使用了一些必填字段验证器我每次点击复位按钮的错误消息显示要求的字段......我试过:
ReuiqredFieldValidator.Enabled = FALSE;
TextBox.Text =;
的Response.Redirect(Samepage.aspx);
的Response.Redirect(Request.RawUrl);
<输入类型=重置>
解决方案
试试这个:
< ASP:按钮
=服务器
ID =reBt
文本=复位
的OnClientClick =this.form.reset();返回false;
的CausesValidation =假
/>
从这里
I want to reset a form but I'm using a few "Required Field Validator" every time I click the reset button the error message shows requiring fields... What I tried:
ReuiqredFieldValidator.Enabled = false;
TextBox.Text="";
Response.Redirect("Samepage.aspx");
Response.Redirect("Request.RawUrl");
<input type=reset>
解决方案
Try this:
<asp:Button
runat="server"
ID="reBt"
Text="Reset"
OnClientClick="this.form.reset();return false;"
CausesValidation="false"
/>
from here