What is a CompareValidatorControl?
CompareValidator is used to make sure that a value matches a specified value. This control is often used when validating passwords. Important properties of this control are .ControlToValidate and .ControlToCompare..ControlTovalidate property is used to set the control to be validated and the .ControlToCompare property is used to identify the control to be compared.
To work with this control drag a CompareValidatorControl, a Command Button and two TextBoxes from the ToolBox. The intention is to enter two values the textboxes. If the two values do not match, an error is generated denoting that the values are not alike.
Set the following control properties in CompareValidatorControl; .ControlToCompare property as TextBox1 and .ControltoValidate property as TextBox2.
Run the code and enter some text in both the textboxes and click the button. If both the TextBox values are the same then no error message will arise else an error.
Written by Sandeep Mogulla, Webmaster at www.startvbdotnet.com
Index
Sponsored links
Villanova University Six Sigma & IT Certificate Programs
100% Online programs in Six Sigma, IS Security, CISSP Prep, Business Analysis, Proj. Mgmt. and more!
100% Online programs in Six Sigma, IS Security, CISSP Prep, Business Analysis, Proj. Mgmt. and more!
ASP.NET 3.5 Hosting on Windows 2008!
ASP.NET 3.5/2.0 Hosting on Windows 2008 & 2003! AJAX, LINQ, & Silverlight Ready! 3 Mo. Free!!
ASP.NET 3.5/2.0 Hosting on Windows 2008 & 2003! AJAX, LINQ, & Silverlight Ready! 3 Mo. Free!!
SFTP components for .NET
Add complete SSH and SFTP support to your .NET framework application
Add complete SSH and SFTP support to your .NET framework application
PureCM Software Configuration Management
Version control and integrated issue tracking - powerful and easy to use. Get your FREE trial now!
Version control and integrated issue tracking - powerful and easy to use. Get your FREE trial now!
Virtual File System SDK
Create your own file systems in Windows and .NET applications
Create your own file systems in Windows and .NET applications
