在ASP.NET重置页面没有回发 [英] Reset a page in ASP.NET without postback

查看:182
本文介绍了在ASP.NET重置页面没有回发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想重新设置形式,但我使用了一些必填字段验证器我每次点击复位按钮的错误消息显示要求的字段......我试过:

  ReuiqredFieldValidator.Enabled = FALSE;
TextBox.Text =;


的Response.Redirect(Samepage.aspx);
的Response.Redirect(Request.RawUrl);

<输入类型=重置>
 

解决方案

试试这个:

 < ASP:按钮
=服务器
ID =reBt
文本=复位
的OnClientClick =this.form.reset();返回false;
的CausesValidation =假
/>
 

从<一个href="http://www.jasinskionline.com/TechnicalWiki/Creating-A-Reset-Button.ashx?AspxAutoDetectCookieSupport=1"相对=nofollow>这里

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

这篇关于在ASP.NET重置页面没有回发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆