【发布时间】:2017-08-07 13:07:49
【问题描述】:
我有问题。我必须将一个文本框与其他两个文本框进行比较,如果值匹配,则它们应该显示一条错误消息。
我尝试了两个比较验证器,但一次只有一个比较验证器有效,所以获取第一个值只能查看我的代码。
<asp:CompareValidator ForeColor="Red" Font-Size="Small" runat="server"
ID="CompareValidator2" controltovalidate="txtsponsorfatherhusbandname"
controltocompare="txtfatherhusbandname" operator="NotEqual" type="String"
errormessage="Sponsor and applicant father name cannot be same" SetFocusOnError="true">
</asp:CompareValidator>
<asp:CompareValidator ForeColor="Red" Font-Size="Small" runat="server"
ID="cmpfather" controltovalidate="txtsponsorname"
controltocompare="txtfatherhusbandname" operator="NotEqual" type="String"
errormessage="Sponsor and applicant father name cannot be same" SetFocusOnError="true">
</asp:CompareValidator>
我曾使用代码文件对其进行编码,但问题是它必须刷新页面,因此如果有任何帮助,将不胜感激。 see the picture i want to check if applicant name is not equal to either Sponsor name and sponsor father husband name and if they are equal then they show a message and focus is on applicant name
【问题讨论】: