链接按钮单击母版页造成内容页验证到火 [英] Link Button Click on Master Page causing Content Page Validators to Fire

查看:92
本文介绍了链接按钮单击母版页造成内容页验证到火的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的ASP.Net页面,我有被放置在母版页几个链接按钮控件。每当我的链接按钮点击,所需的字段验证这是内容页面的一部分被解雇了。

In my ASP.Net page, i have a few link button controls which are placed in the master page. Whenever i click on the link button , the required field validators which are part of content page gets fired.

我不希望验证当有人点击链接按钮这是母版页的一部分火。有什么办法,我可以设置通过JavaScript Page.ClientValidate()为真?

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 ??

推荐答案

还有,你可以设置为false,这样控件的CausesValidation属性。

There's a CausesValidation property which you can set to false for such controls.

您也可以运行到您wan't保持验证组独立的情况,然后有一个ValidationGroup属性为。相同的验证组内只有控制触发验证在这种情况下。默认情况下,所有控件都属于验证组没有名字(空字符串),这就是为什么你遇到了这一问题。

You may also run into a situation where you wan't to keep validation groups seperate, then there's a ValidationGroup property for that. 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.

这篇关于链接按钮单击母版页造成内容页验证到火的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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