如何逃离必填字段验证器 [英] How to Escape from required field validator

查看:141
本文介绍了如何逃离必填字段验证器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.
我有一个注册用户数据的表格.一些TextBoxes有必填字段验证器.我想清除后面的表单(使文本框为空)代码,并且需要回发,但requiredfieldvalidator不允许我回发.
因此,当有必填字段验证器时,如何进行回发并清除表单?

Hello guys.
I have a form that registers users data.there is requiredfieldvalidator for some TextBoxes. I want to clear my form (make textboxes empty) code behind and it need to have a Postback but requiredfieldvalidator doesn''t let me to postback.
so how can i have a postback and clear my form when there is a requiredfieldvalidator?

推荐答案



其他替代方法是使用验证组.也会为您服务,

谢谢
-Amit
Hi,

Other alternative is to use Validation Groups. that will also work for you,

thanks
-Amit


在清除"按钮中,设置CausesValidation ="False"

In Clear button, Set the CausesValidation="False"

<asp:Button CausesValidation="False" ....... />



详情请参阅
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.causesvalidation.aspx [



Refer for more details
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.causesvalidation.aspx[^]


这篇关于如何逃离必填字段验证器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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