?
Solved

ASP.NET Compare Validator

Posted on 2012-03-22
7
Medium Priority
?
385 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month15 days, 23 hours left to enroll

850 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