ASP.NET CompareValidator: Verifying that UserID and Password are not the same
Posted on 2014-02-04
I have two text boxes: txtProviderId and txtProviderPassword. I'm trying to compare the values, verifying that they are not same; user id and password cannot be the same. I'm using the CompareValidator control and the code is as follows:
<asp:CompareValidator ID="cvProviderIDPswd" runat="server"
ErrorMessage="Provider password must be different from Provider ID"
When I test my program and add the same value to both textboxes, the CompareValidator control is not detecting that they are not equal and I do not an error message.
Can someone please tell me what I am doing wrong? Thank you