Breaking News

Compare Validator In ASP.Net

Know More : Microsoft ASP.Net  Microsoft VB.Net  Microsoft C#.Net  Microsoft Sliverlight  XMLMicrosoft WPF  Microsoft WCF Ajax Microsoft SQL Server


This control is used to perform comparison between a value entered with another value. The other value can be a number or a value entered into another control. If you want to compare a specific data entry control with another data entry control, set the ControlToCompare property to specify the control to compare with.You can compare the value of a data entry control to a constant value. In this case ,you specify the constant value to compare with a setting the ValueToCompare.Let’s start in Microsoft Visual Studio 2010 , Create a new website name  it  compare validator for textbox . After this, drag button,label, textbox ,compare validator controls from toolbox you see in figure.
ScreenShot097
After drag controls from toolbox , now go to properties of compare validator. I have set the comparison validator’s ControlToValidate property to textbox2 , and its ControlToCompare property to Textbox1.I have also set the type property to integer and the operator property to LessThan.You can compare to a constant value just use the ValueToCompare property.And as with other validation controls,you set the ControlToValidate property  to set the control whose data you want to validates,and place the error message in the ErrorMessage property.As shown in figure..



ScreenShot095
Now press F5 or select debug from debug menu , a debug window will be open and select “Run without debugging” your web page will be open in default browser.
ScreenShot096
In figure , you can see the comparison validator displaying its error message when the user corrects the situation in one or the other textboxes and the text box loses the focus, the comparison validator will test the data again.Thanks.

Know More : Microsoft ASP.Net  Microsoft VB.Net  Microsoft C#.Net  Microsoft Sliverlight  XMLMicrosoft WPF  Microsoft WCF Ajax Microsoft SQL Server

4 comments:

  1. Thanks.. NIce Post

    Pooja

    MLM Developers India

    http://mlmdevelopers.com/products/mlm-software/corporate-mlm-soft/feature.html

    ReplyDelete
  2. hi... thanks for such a great info......

    ReplyDelete
  3. Thanks a lot for sharing this nice post!You’ve done really excellent job!

    ReplyDelete
  4. i need a mobile sms system software do you made for me

    ReplyDelete