0% found this document useful (0 votes)
4 views

Chapter Four ASP.net (5)

The document discusses the importance of validating user input in ASP.NET Web forms to prevent errors and security vulnerabilities, such as SQL injection attacks. It outlines various types of validation controls provided by ASP.NET, including Required Field Validator, Range Validator, Compare Validator, Regular Expression Validator, and Validation Summary. These controls help developers manage user input effectively by displaying error messages and ensuring data integrity.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Chapter Four ASP.net (5)

The document discusses the importance of validating user input in ASP.NET Web forms to prevent errors and security vulnerabilities, such as SQL injection attacks. It outlines various types of validation controls provided by ASP.NET, including Required Field Validator, Range Validator, Compare Validator, Regular Expression Validator, and Validation Summary. These controls help developers manage user input effectively by displaying error messages and ensuring data integrity.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Validations

Understanding Validation

• Validating user input in ASP.NET Web forms is one of the most


important tasks for developers. Users are very unpredictable when it
comes to supplying information such as:
 Users might ignore an important field and leave it blank.

 Users might try to type a short string of nonsense to circumvent


a required field Check.
 Users might make an honest mistake
Validation
Validating user input is a common scenario in a Web based
application.

Users are not interested to enter the correct data into a form.
Developers spend more time for checking user’s input.
Understanding Validation

• Malicious users might try to exploit a weakness in your code by


entering carefully structured wrong values. For example, they might
attempt to cause a specific error that will reveal sensitive information.

• A more dramatic example of this technique is the SQL injection


attack , where user-supplied values change the operation of a
dynamically constructed database command
ASP.NET Validation

• ASP.NET aims to save you this trouble and provide you with a reusable
framework of validation controls that manages validation details by checking
fields and reporting on errors automatically.

• ASP.NET Validation server controls allow you to easily validate any data a
user has entered in a Web form.

• Validation controls allow you to completely customize the way error


messages are displayed to users when data values don’t pass validation.
Validation
ASP.NET provides a set of validation controls that provide an way to
check for errors.

Validation controls display messages to the user.


TYPES of Validation
Required FieldValidator.
Compare Validator.
Range Validator.
Regular Expression Validator.
Custom Validator.
Validation Summary.
Required Field Validator
• Ensures that the user does not skip an entry.
Range Validator
Check the user’s entry is between specified lower and upper
boundaries.

You can check ranges of numbers ,characters and dates.


Compare Validator
Compare user’s entry against a constrant value of another control.

Compare data using Comparison operator or type of data.


Regular Expression Validator
Regular expression is used to check a predictable sequence of
character.

Check that the entry matches a pattern defined by a regular


expression.
Validation Summary
Validation Summary does not perform any validation.

Validation Summary display error messages from all validation


controls.
THE END.
Prepared by Eng:Abdiwahab Osman siad
Thank u all
Prepared by Eng:Abdiwahab Osman siad

You might also like