Tutorials
ASP.NET
ASP .NET: Validating User Input with C#
Required Field Validator
Regular Expression Validator
Range Validator
Compare Validator
Custom Validator
Validation Summary ControlThe compare validator control is used to compare the input server control's value. The compare validator can be used to compare against a value or another control. If both the ControlToCompare and ValueToCompare properties are set for a CompareValidator control, the ControlToCompare property takes precedence.
A good use of the compare validator is to check whether the passwords entered by the user in the two TextBoxes while registering for a website are same or not. This validator also performs validation on the client side as well as the server side. So, no postback will be required when doing the comparison and hence resources will be saved and performance will increase.
Next Page: Custom Validator
| The course material is very helpful |
| :D Good day! I used validators in my web app and running them locally but my problem is when I copy the system in the live environment the validator did not work. Any possible solution? I check the properties of the validator and compare them in all the examples found in the internet but I have the same result. Can you help me in my problem? :'( |
| this will be really helpful not only for experienced developers but for beginners also. |
|
how can i get the page to pass thru if its not valid ie, id like to be able to write some like this if (Page.IsPostBack) { Page.Validate; if (Page.IsValid) { do seomthing } else { do something else } } but the something else doesnt work cuase as soon as it doesnt pass the validators it never gets past the postback am i barking up the wrong tree here? thanks for any help |
|
This is really a very helpful n nice article. I really behefited from it and enjoyed it. ;D |
|
Hi , This is vaibhav. I recently started to learn self .NET. Initially i found it to be harder than j2EE but tnow I realised that its a preety easy. This article helped me alot to know the basic concepts. |
| thank you very much, help me solve a tough problem^^ |
| I had some doubt in validaton ontrols .. now i got some idea after reaing this article.. thanks for this aticle writer........... |
|
Thanks for the nice article..solve my problems.. --jamesbond-- |
|
This is a compact and easy to read n understand material. This is very very useful for quick review. Thanksto the writer. |
| how to make owr own regular expressions using the using System.Text.RegularExpressions; |
|
hi, I started .net recently and want to know that how I can apply a validation to a text box so that it can not be leave blank. what I'm trying is if (TxtRegNo.Text.ToString() == "") { MessageBox.Show("Fill Registration no"); } It is working but it saves that blank data into the database. plz give me a solution |
| I want to make validation for ASP.NET with C# how can I put it and for 1 time I want to use the validation for all the pages. |