SlideShare a Scribd company logo
1 of 10
KS TECHNOLOGIES
Visit us: http://www.kstechnologies.co
Live Project training for BCA / MCA / BE / Diploma
in Vadodara
For Details Call us @ +91-84870 42221, +91-98245 07547
VALIDATION
CONTROLS IN
ASP.NET
Visit us: http://www.kstechnologies.co
Validation Controls
 ASP.NET validation controls validate the user
input data to ensure that useless,
unauthenticated, or contradictory data don't get
stored.
 ASP.NET provides the following validation
controls:
 RequiredFieldValidator
 RangeValidator
 CompareValidator
 RegularExpressionValidator
 CustomValidator
 ValidationSummary
RequiredFieldValidator Control
 The RequiredFieldValidator control ensures
that the required field is not empty. It is
generally tied to a text box to force input into
the text box.
RangeValidator Control
 The RangeValidator control verifies that the
input value falls within a predetermined range.
 It has three specific properties:
 Properties Description Type It defines the type
of the data. The available values are:
Currency, Date, Double, Integer, and String.
MinimumValue It specifies the minimum value
of the range. MaximumValue It specifies the
maximum value of the range.
CompareValidator Control
 The CompareValidator control compares a value
in one control with a fixed value or a value in
another control.
 It has the following specific properties:
 Properties Description Type It specifies the data
type. ControlToCompare It specifies the value of
the input control to compare with.
ValueToCompare It specifies the constant value to
compare with. Operator It specifies the
comparison operator, the available values are:
Equal, NotEqual, GreaterThan,
GreaterThanEqual, LessThan, LessThanEqual,
RegularExpressionValidator
 The RegularExpressionValidator allows validating
the input text by matching against a pattern of a
regular expression. The regular expression is set
in the ValidationExpression property.
 The following table summarizes the commonly
used syntax constructs for regular expressions:
 Character Escapes Description b Matches a
backspace. t Matches a tab. r Matches a
carriage return. v Matches a vertical tab. f
Matches a form feed. n Matches a new line. 
Escape character.
CustomValidator
 he CustomValidator control allows writing
application specific custom validation routines for
both the client side and the server side validation.
 The client side validation is accomplished through
the ClientValidationFunction property. The client
side validation routine should be written in a
scripting language, such as JavaScript or
VBScript, which the browser can understand.
 The server side validation routine must be called
from the control's ServerValidate event handler.
The server side validation routine should be
written in any .Net language, like C# or VB.Net.
ValidationSummary
 The ValidationSummary control does not perform
any validation but shows a summary of all errors
in the page. The summary displays the values of
the ErrorMessage property of all validation
controls that failed validation.
 The following two mutually inclusive properties list
out the error message:
 ShowSummary : shows the error messages in
specified format.
 ShowMessageBox : shows the error messages
in a separate window.
Validation controls in asp

More Related Content

What's hot

What's hot (20)

What is an API?
What is an API?What is an API?
What is an API?
 
Form Validation in JavaScript
Form Validation in JavaScriptForm Validation in JavaScript
Form Validation in JavaScript
 
Web forms in ASP.net
Web forms in ASP.netWeb forms in ASP.net
Web forms in ASP.net
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
java Features
java Featuresjava Features
java Features
 
Attributes of output Primitive
Attributes of output Primitive Attributes of output Primitive
Attributes of output Primitive
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
 
Application Logging Good Bad Ugly ... Beautiful?
Application Logging Good Bad Ugly ... Beautiful?Application Logging Good Bad Ugly ... Beautiful?
Application Logging Good Bad Ugly ... Beautiful?
 
Validation Controls in asp.net
Validation Controls in asp.netValidation Controls in asp.net
Validation Controls in asp.net
 
Application development framework
Application development frameworkApplication development framework
Application development framework
 
C#.NET
C#.NETC#.NET
C#.NET
 
Introduction to Swagger
Introduction to SwaggerIntroduction to Swagger
Introduction to Swagger
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
 
Overview of PHP and MYSQL
Overview of PHP and MYSQLOverview of PHP and MYSQL
Overview of PHP and MYSQL
 
Java API
Java APIJava API
Java API
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Asp.net basic
Asp.net basicAsp.net basic
Asp.net basic
 
Php Presentation
Php PresentationPhp Presentation
Php Presentation
 
Ajax Ppt 1
Ajax Ppt 1Ajax Ppt 1
Ajax Ppt 1
 
graphics programming in java
graphics programming in javagraphics programming in java
graphics programming in java
 

Viewers also liked

Bca sem 5 c# practical
Bca sem 5 c# practicalBca sem 5 c# practical
Bca sem 5 c# practical
Hitesh Patel
 
TYBSC IT SEM 6 IPR/CL
TYBSC IT SEM 6 IPR/CLTYBSC IT SEM 6 IPR/CL
TYBSC IT SEM 6 IPR/CL
WE-IT TUTORIALS
 
TYBSC IT SEM 6 PROJECT MANAGEMENT NOTES
TYBSC IT SEM 6 PROJECT MANAGEMENT NOTESTYBSC IT SEM 6 PROJECT MANAGEMENT NOTES
TYBSC IT SEM 6 PROJECT MANAGEMENT NOTES
WE-IT TUTORIALS
 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notes
WE-IT TUTORIALS
 

Viewers also liked (11)

Nikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd YearNikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd Year
 
Licenças para área de restinga
Licenças para área de restingaLicenças para área de restinga
Licenças para área de restinga
 
Bca sem 5 c# practical
Bca sem 5 c# practicalBca sem 5 c# practical
Bca sem 5 c# practical
 
ASP.NET State management
ASP.NET State managementASP.NET State management
ASP.NET State management
 
State management in ASP.NET
State management in ASP.NETState management in ASP.NET
State management in ASP.NET
 
ASP .net MVC
ASP .net MVCASP .net MVC
ASP .net MVC
 
TYBSC IT SEM 6 IPR/CL
TYBSC IT SEM 6 IPR/CLTYBSC IT SEM 6 IPR/CL
TYBSC IT SEM 6 IPR/CL
 
TYBSC IT SEM 6 PROJECT MANAGEMENT NOTES
TYBSC IT SEM 6 PROJECT MANAGEMENT NOTESTYBSC IT SEM 6 PROJECT MANAGEMENT NOTES
TYBSC IT SEM 6 PROJECT MANAGEMENT NOTES
 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notes
 
Online voting system ppt by anoop
Online voting system ppt by anoopOnline voting system ppt by anoop
Online voting system ppt by anoop
 
Network security unit 1,2,3
Network security unit 1,2,3 Network security unit 1,2,3
Network security unit 1,2,3
 

Similar to Validation controls in asp

vnd.openxmlformats-officedocument.presentationml.presentation&rendition=1.pptx
vnd.openxmlformats-officedocument.presentationml.presentation&rendition=1.pptxvnd.openxmlformats-officedocument.presentationml.presentation&rendition=1.pptx
vnd.openxmlformats-officedocument.presentationml.presentation&rendition=1.pptx
YamunaS38
 
Validation controls ppt
Validation controls pptValidation controls ppt
Validation controls ppt
Iblesoft
 
ASP.NET Session 10
ASP.NET Session 10ASP.NET Session 10
ASP.NET Session 10
Sisir Ghosh
 

Similar to Validation controls in asp (20)

Asp.net validation
Asp.net validationAsp.net validation
Asp.net validation
 
Validation in asp.net
Validation in asp.netValidation in asp.net
Validation in asp.net
 
vnd.openxmlformats-officedocument.presentationml.presentation&rendition=1.pptx
vnd.openxmlformats-officedocument.presentationml.presentation&rendition=1.pptxvnd.openxmlformats-officedocument.presentationml.presentation&rendition=1.pptx
vnd.openxmlformats-officedocument.presentationml.presentation&rendition=1.pptx
 
Introduction to validation
Introduction to validationIntroduction to validation
Introduction to validation
 
validation-controls.pdf ioue8n uoh souu o3i
validation-controls.pdf ioue8n uoh souu  o3ivalidation-controls.pdf ioue8n uoh souu  o3i
validation-controls.pdf ioue8n uoh souu o3i
 
Validation controls in asp
Validation controls in aspValidation controls in asp
Validation controls in asp
 
Chapter 3 (validation control)
Chapter 3 (validation control)Chapter 3 (validation control)
Chapter 3 (validation control)
 
validations in asp .net
validations in asp .netvalidations in asp .net
validations in asp .net
 
Validation controls ASP .NET
Validation controls ASP .NETValidation controls ASP .NET
Validation controls ASP .NET
 
2310 b 07
2310 b 072310 b 07
2310 b 07
 
Validation controls ppt
Validation controls pptValidation controls ppt
Validation controls ppt
 
ASP.NET Session 10
ASP.NET Session 10ASP.NET Session 10
ASP.NET Session 10
 
Chapter 9
Chapter 9Chapter 9
Chapter 9
 
validation
validationvalidation
validation
 
validation of aap.net
validation of aap.netvalidation of aap.net
validation of aap.net
 
Input validation errors
Input validation errorsInput validation errors
Input validation errors
 
validation
validationvalidation
validation
 
44CON 2013 - .Net Havoc - Manipulating Properties of Dormant Server Side Web ...
44CON 2013 - .Net Havoc - Manipulating Properties of Dormant Server Side Web ...44CON 2013 - .Net Havoc - Manipulating Properties of Dormant Server Side Web ...
44CON 2013 - .Net Havoc - Manipulating Properties of Dormant Server Side Web ...
 
Validation in Jakarta Struts 1.3
Validation in Jakarta Struts 1.3Validation in Jakarta Struts 1.3
Validation in Jakarta Struts 1.3
 
validation & regular expression chacteristics
validation & regular expression chacteristicsvalidation & regular expression chacteristics
validation & regular expression chacteristics
 

Recently uploaded

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Recently uploaded (20)

latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answers
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 

Validation controls in asp

  • 1. KS TECHNOLOGIES Visit us: http://www.kstechnologies.co Live Project training for BCA / MCA / BE / Diploma in Vadodara For Details Call us @ +91-84870 42221, +91-98245 07547
  • 2. VALIDATION CONTROLS IN ASP.NET Visit us: http://www.kstechnologies.co
  • 3. Validation Controls  ASP.NET validation controls validate the user input data to ensure that useless, unauthenticated, or contradictory data don't get stored.  ASP.NET provides the following validation controls:  RequiredFieldValidator  RangeValidator  CompareValidator  RegularExpressionValidator  CustomValidator  ValidationSummary
  • 4. RequiredFieldValidator Control  The RequiredFieldValidator control ensures that the required field is not empty. It is generally tied to a text box to force input into the text box.
  • 5. RangeValidator Control  The RangeValidator control verifies that the input value falls within a predetermined range.  It has three specific properties:  Properties Description Type It defines the type of the data. The available values are: Currency, Date, Double, Integer, and String. MinimumValue It specifies the minimum value of the range. MaximumValue It specifies the maximum value of the range.
  • 6. CompareValidator Control  The CompareValidator control compares a value in one control with a fixed value or a value in another control.  It has the following specific properties:  Properties Description Type It specifies the data type. ControlToCompare It specifies the value of the input control to compare with. ValueToCompare It specifies the constant value to compare with. Operator It specifies the comparison operator, the available values are: Equal, NotEqual, GreaterThan, GreaterThanEqual, LessThan, LessThanEqual,
  • 7. RegularExpressionValidator  The RegularExpressionValidator allows validating the input text by matching against a pattern of a regular expression. The regular expression is set in the ValidationExpression property.  The following table summarizes the commonly used syntax constructs for regular expressions:  Character Escapes Description b Matches a backspace. t Matches a tab. r Matches a carriage return. v Matches a vertical tab. f Matches a form feed. n Matches a new line. Escape character.
  • 8. CustomValidator  he CustomValidator control allows writing application specific custom validation routines for both the client side and the server side validation.  The client side validation is accomplished through the ClientValidationFunction property. The client side validation routine should be written in a scripting language, such as JavaScript or VBScript, which the browser can understand.  The server side validation routine must be called from the control's ServerValidate event handler. The server side validation routine should be written in any .Net language, like C# or VB.Net.
  • 9. ValidationSummary  The ValidationSummary control does not perform any validation but shows a summary of all errors in the page. The summary displays the values of the ErrorMessage property of all validation controls that failed validation.  The following two mutually inclusive properties list out the error message:  ShowSummary : shows the error messages in specified format.  ShowMessageBox : shows the error messages in a separate window.