简体   繁体   English

链接按钮单击母版页,导致内容页验证程序触发

[英]Link Button Click on Master Page causing Content Page Validators to Fire

In my ASP.Net page, i have a few link button controls which are placed in the master page. 在我的ASP.Net页面中,我有一些链接按钮控件,它们位于母版页中。 Whenever i click on the link button , the required field validators which are part of content page gets fired. 每当我单击链接按钮时,就会触发内容页面中必填的字段验证器。

I don't want the validators to fire when someone clicks on the Link Buttons which are part of master page. 当有人单击母版页上的链接按钮时,我不希望验证器触发。 Is there any way i can set the Page.ClientValidate() to true through javascript ?? 有什么办法可以通过javascript将Page.ClientValidate()设置为true?

There's a CausesValidation property which you can set to false for such controls. 有一个CausesValidation属性,您可以将此类控件设置为false。

You may also run into a situation where you wan't to keep validation groups seperate, then there's a ValidationGroup property for that. 您可能还会遇到无法将验证组分开的情况,因此有一个ValidationGroup属性。 Only controls within the same validation group triggers validation in such cases. 在这种情况下,只有同一验证组中的控件才触发验证。 By default, all controls belong to the validation group without a name (empty string), that's why you're experiencing this problem. 默认情况下,所有控件都属于没有名称(空字符串)的验证组,这就是您遇到此问题的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM