Codefixer - ASP tutorials, resources and software
ASP.NET Hosting with US & UK Data Centers!
Home   Articles   Resources   ASP directory   ASP Tutorials   Code Snippets   ASP Applications   Forum
Thursday 20 November
MembersPro PayPal - ASP Membership software

New MS SQL 2008 Available – DiscountASP.NET


ASP Partner ASP Partner ASP Partner more partners...

ASP.NET Validation Controls Part 1

Importance of Form Validation

Form validation ensures a user not only enters or selects values when required but also enters appropriate and correctly formatted values. Feedback, contact and registration forms as well as content management systems that support insert, update and delete functions are all common scenarios where form validation should be implemented.

It’s important to ensure that data you store in a database is standardized, comprehensive and complete. Incorrectly formatted email addresses, invalid phone numbers or empty shipping addresses amongst other things will undermine the effectiveness and quality of  the data in your web application.

You should also be wary of script errors that might be caused by a user entering incorrect variable types e.g. a user entering a string in a mortgage calculation box when an integer is required. Form validation also protects against a malicious user attempting to directly enter HTML, Javascript, SQL or other inappropriate code.

Validation in ASP was time consuming and cumbersome. The ASP.NET team in their wisdom tackled this area and developed the validation controls to make form validation a lot fastier and easier.

The Validation Controls

With ASP.NET 2.0 there are now 6 validation controls including the ValidationSummary control.

Control Name Purpose
RequiredFieldValidator To ensure the user inputs a value
RegularExpressionValidator To ensure that the value entered follows a specified pattern
RangeValidator To ensure the input falls between 2 specified values
CompareValidator To compare the value of one input control against the value of another input control or a fixed value
CustomValidator Allows you to enter your own validation code
ValidationSummary To display a summary report of all the validation errors in a page or within a validation group

 

Read Part 2 How do Validation Controls work?





ASP.NET 3.5/2.0 Web Hosting: 3 Months FREE – Click Here!




About | Contact | Advertise | Feedback | Hire Us | Link

Site developed by Michael Wall - Web Design Belfast N.Ireland.
Copyright © 2000-2008. All rights reserved.

Do you intend to move to ASP.NET or have you already?
Yes will do
Have done
ASP does fine
Not a priority


Directory Software