当我使用Ajax ValidatorCalloutExtender控件时如何隐藏验证控件的错误消息 [英] How to hide error message of validation control when i use ajax ValidatorCalloutExtender Control

查看:53
本文介绍了当我使用Ajax ValidatorCalloutExtender控件时如何隐藏验证控件的错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将RequiredFieldValidator与ValidatorCalloutExtender Ajax控件一起使用.问题是,当触发验证时,RequiredFieldValidator显示的错误消息以及ValidatorCalloutExtender Ajax控件引发的消息.验证完成后,我只想显示ValidatorCalloutExtender Ajax控件抛出的错误消息.
如果您有想法,请提供解决方案.下面我为两个控件提供标签.

I have use RequiredFieldValidator with ValidatorCalloutExtender ajax control. Problem is that when validation is fired than error message of RequiredFieldValidator display along with message throw by ValidatorCalloutExtender ajax control. I want to display only error message throw by ValidatorCalloutExtender ajax control when validation done.
If you have idea abt it then give solution of it.Below i give tag for both controls.

<asp:RequiredFieldValidator  ID="RequiredFieldValidator1" runat="server" ErrorMessage="Value Required!" Text="*" Display="None" ControlToValidate="TextBox1" ValidationGroup="Insert" ></asp:RequiredFieldValidator>

<ajax:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender1" TargetControlID="RequiredFieldValidator1" Width="200px"

      PopupPosition="Right"/>

推荐答案

尝试以下操作:
Try this:
<asp:requiredfieldvalidator id="rfvStatus" runat="server" validationgroup="RO" controltovalidate="txtStatus" errormessage="Select the status." display="None" initialvalue="Select"/>
<cc1:validatorcalloutextender id="vceStatus"  runat="server" targetcontrolid="rfvStatus" popupposition="Right"></cc1:validatorcalloutextender>





--Amit





--Amit


看看这个链接
LINK1
LINK2
Have a look on this links
LINK1
LINK2


您可以简单地做到这一点将其显示属性写入NONE.作为参考,您可以查看下面提供的代码..

You can do it by simply writing its Display Property to NONE. For REference you can see the code provided below..

<asp:textbox id="txtWebSite1" runat="server" xmlns:asp="#unknown"></asp:textbox>
<asp:requiredfieldvalidator id="RequiredFieldValidator10" runat="server" controltovalidate="txtWebSite1" validationgroup="popup" display="None" errormessage="Website is Required." xmlns:asp="#unknown">
</asp:requiredfieldvalidator>



在这里,您可以看到我提供了 Display ="None" ,这样它就不会在文本框中显示.但它会显示在< asp:validationsummary xmlns:asp =#unknown">中.块.

祝你有美好的一天.....



Here, you can see i have provided Display="None" so that it will not going to be displayed besides text box. but it will show in the <asp:validationsummary xmlns:asp="#unknown"> block.

Have a Nice DAY.....


这篇关于当我使用Ajax ValidatorCalloutExtender控件时如何隐藏验证控件的错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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