Solved

ASP.NET Compare Validator

Posted on 2012-03-22
7
358 Views
Last Modified: 2012-04-17
I have a web page that contains 3 textboxes

-  OldPwd
-  NewPwd
-  ConfirmPwd

I want to use the control validator to check that the OldPwd does not match the NewPwd.

Any ideas?
0
Comment
Question by:CipherIS
7 Comments
 
LVL 18

Expert Comment

by:Anil Golamari
ID: 37753807
Can you try something like below:

<asp:CompareValidator ID="CompareValidator1"
     runat="server"
     ControlToCompare="NewPassword" // ID of your new password field
     ControlToValidate="CurrentPassword"  //ID of  current password field
     ErrorMessage="You should enter different password."
     ForeColor="Red">
</asp:CompareValidator>
0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 37753810
Use the ASP.net compare validation control :

http://asp.net-tutorials.com/validation/compare-validator/
0
 
LVL 18

Expert Comment

by:Anil Golamari
ID: 37753814
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
LVL 7

Expert Comment

by:Lalit Chandra
ID: 37753846
you should go to the link
http://www.eggheadcafe.com/community/asp-net/17/10174518/password-matching.aspx

Hope this will fix your problem.
0
 
LVL 5

Expert Comment

by:Vishal Kedar
ID: 37770254
try below code

<asp:CompareValidator ID="CompareValidator1"
     runat="server"
     ControlToCompare="NewPassword" // ID of your new password field
     ControlToValidate="CurrentPassword"  //ID of  current password field
     ErrorMessage="You should enter different password."    
     Operator="NotEqual"                    
     type="String"
     ForeColor="Red">
</asp:CompareValidator>
0
 
LVL 1

Accepted Solution

by:
CipherIS earned 0 total points
ID: 37813677
above does no work
0
 
LVL 1

Author Closing Comment

by:CipherIS
ID: 37854956
Was not provided solution that worked.
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question