问题描述
我已将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"/>
推荐答案
<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
<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控件时如何隐藏验证控件的错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!