[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

ASP.NET Compare Validator

Posted on 2012-03-22
7
Medium Priority
?
381 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

649 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