如何使用验证控件 [英] how to use validation control
本文介绍了如何使用验证控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用必需的字段验证器和ajax扩展器.
但是当我单击取消"按钮时,也会触发必填字段验证.
我正在ajax的标签控件上使用该评估.
因此无法从该页面导航.
我是ajax的初学者,所以任何人都可以帮助我.
i am using required field validator and ajax extender.
but when i am clicking the cancel button then also required field valdation fired.
i am using that valdations on ajax''s tab control.
so cant navigate from that page.
i am beginner to ajax so plz anyone can help me out plz.
推荐答案
按钮的一个属性CausesValidation.将其设置为false:
There is a property of the button, CausesValidation. Set it to false as:
<asp:Button ID="Button1" runat="server" Text="Button" CausesValidation="False"/>
解决方案1:
设置取消按钮< code> CausesValidation</code>属性为false
解决方法2:
使用ValidationGroup属性(RequiredFieldValidator以及您需要使用的所有其他控件的属性).不要为此设置取消按钮.
Resolution 1:
Set the cancel button <code>CausesValidation</code> property to false
Resolution 2:
Use ValidationGroup attribute (of RequiredFieldValidator and all other controls you need to use for). Don''t set this for cancel button.
这篇关于如何使用验证控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文