Solved

ASP.NET Compare Validator

Posted on 2012-03-22
7
342 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HttpPostedFile 1 26
Disable Security Alert  popup in Winforms  embedded webbrowser. 1 30
VB: Convert 2 dates to specific format 24 48
What Does This C# Code Block Do? 5 31
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

810 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