SlideShare a Scribd company logo
ASP.NET 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:
• Required Field Validator
• Range Validator
• Compare Validator
• Regular Expression Validator
• Custom Validator
• Validation Summary
BASE VALIDATOR CLASS
The validation control classes are inherited from the
BaseValidator class hence they inherit its properties and
methods.The properties and the methods of this base class,
which are common for all the validation controls:
BASE VALIDATOR CLASS
REQUIRED FIELD VALIDATOR
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.
The syntax of the control is as given:
RANGE VALIDATOR CONTROL
 The RangeValidator control verifies that the input
value falls within a predetermined range.
 It has three specific properties:
 The syntax of the control is as given:
RANGE VALIDATOR CONTROL
COMPARE VALIDATOR 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:
 The basic syntax of the control is as
follows:
COMPARE VALIDATOR CONTROL
REGULAR EXPRESSION VALIDATOR
 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:
Apart from single character match, a class of characters
could be specified that can be matched,called the
metacharacters.
REGULAR EXPRESSION VALIDATOR
 Quantifiers could be added to specify number of times
a character could appear.
REGULAR EXPRESSION VALIDATOR
 The syntax of the control is as given:
REGULAR EXPRESSION VALIDATOR
CUSTOM VALIDATOR
 The 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.
 The basic syntax for the control is as
given:
CUSTOM VALIDATOR
VALIDATION SUMMARY
 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.
 The syntax for the control is as given:
VALIDATION GROUPS
 Complex pages have different groups of information
provided in different panels. In such situation, a need
might arise for performing validation separately for
separate group. This kind of situation is handled using
validation groups.
 To create a validation group, you should put the input
controls and the validation controls into the same logical
group by setting their ValidationGroupproperty.

More Related Content

What's hot

Unit 1 defects classes
Unit 1 defects classesUnit 1 defects classes
Unit 1 defects classes
Roselin Mary S
 
Asp .net web form fundamentals
Asp .net web form fundamentalsAsp .net web form fundamentals
Asp .net web form fundamentalsGopal Ji Singh
 
Design Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software EngineeringDesign Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software Engineering
Meghaj Mallick
 
Validation testing
Validation testingValidation testing
Validation testingSlideshare
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
ShudipPal
 
Controls
ControlsControls
Controls
teach4uin
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
Abhishek Sur
 
Introduction to java beans
Introduction to java beansIntroduction to java beans
Introduction to java beans
Hitesh Parmar
 
Lecture 16 requirements modeling - scenario, information and analysis classes
Lecture 16   requirements modeling - scenario, information and analysis classesLecture 16   requirements modeling - scenario, information and analysis classes
Lecture 16 requirements modeling - scenario, information and analysis classes
IIUI
 
Advanced topics in software engineering
Advanced topics in software engineeringAdvanced topics in software engineering
Advanced topics in software engineering
Rupesh Vaishnav
 
White Box Testing
White Box Testing White Box Testing
White Box Testing
MariamKhan120
 
Flow oriented modeling
Flow oriented modelingFlow oriented modeling
Flow oriented modelingramyaaswin
 
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML Diagrams
Manish Kumar
 
Deadlock dbms
Deadlock dbmsDeadlock dbms
Deadlock dbms
Vardhil Patel
 
Boundary value analysis
Boundary value analysisBoundary value analysis
Boundary value analysis
Vadym Muliavka
 
REQUIREMENT ENGINEERING
REQUIREMENT ENGINEERINGREQUIREMENT ENGINEERING
REQUIREMENT ENGINEERING
Saqib Raza
 
Software Engineering unit 4
Software Engineering unit 4Software Engineering unit 4
Software Engineering unit 4
Abhimanyu Mishra
 
Software Testing Principles
Software Testing PrinciplesSoftware Testing Principles
Software Testing Principles
Kanoah
 
Test Execution
Test ExecutionTest Execution
Test Execution
Rajathi-QA
 
Requirements elicitation
Requirements elicitationRequirements elicitation
Requirements elicitation
Syed Zaid Irshad
 

What's hot (20)

Unit 1 defects classes
Unit 1 defects classesUnit 1 defects classes
Unit 1 defects classes
 
Asp .net web form fundamentals
Asp .net web form fundamentalsAsp .net web form fundamentals
Asp .net web form fundamentals
 
Design Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software EngineeringDesign Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software Engineering
 
Validation testing
Validation testingValidation testing
Validation testing
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
 
Controls
ControlsControls
Controls
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
 
Introduction to java beans
Introduction to java beansIntroduction to java beans
Introduction to java beans
 
Lecture 16 requirements modeling - scenario, information and analysis classes
Lecture 16   requirements modeling - scenario, information and analysis classesLecture 16   requirements modeling - scenario, information and analysis classes
Lecture 16 requirements modeling - scenario, information and analysis classes
 
Advanced topics in software engineering
Advanced topics in software engineeringAdvanced topics in software engineering
Advanced topics in software engineering
 
White Box Testing
White Box Testing White Box Testing
White Box Testing
 
Flow oriented modeling
Flow oriented modelingFlow oriented modeling
Flow oriented modeling
 
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML Diagrams
 
Deadlock dbms
Deadlock dbmsDeadlock dbms
Deadlock dbms
 
Boundary value analysis
Boundary value analysisBoundary value analysis
Boundary value analysis
 
REQUIREMENT ENGINEERING
REQUIREMENT ENGINEERINGREQUIREMENT ENGINEERING
REQUIREMENT ENGINEERING
 
Software Engineering unit 4
Software Engineering unit 4Software Engineering unit 4
Software Engineering unit 4
 
Software Testing Principles
Software Testing PrinciplesSoftware Testing Principles
Software Testing Principles
 
Test Execution
Test ExecutionTest Execution
Test Execution
 
Requirements elicitation
Requirements elicitationRequirements elicitation
Requirements elicitation
 

Similar to Asp.net validation

Validation in asp.net
Validation in asp.netValidation in asp.net
Validation in asp.net
Sireesh K
 
Validation controls in asp
Validation controls in aspValidation controls in asp
Validation controls in asp
KS Technologies Vadodara
 
Introduction to validation
Introduction to validationIntroduction to validation
Introduction to validation
rlavadiya
 
Asp.NET Validation controls
Asp.NET Validation controlsAsp.NET Validation controls
Asp.NET Validation controls
Guddu gupta
 
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 in asp
Validation controls in aspValidation controls in asp
Validation controls in asp
Shishir Jain
 
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
CoRRexGaMing
 
validation of aap.net
validation of aap.netvalidation of aap.net
validation of aap.net
Pratiksha Srivastava
 
Validation controls ppt
Validation controls pptValidation controls ppt
Validation controls pptIblesoft
 
validations in asp .net
validations in asp .netvalidations in asp .net
validations in asp .net
Akshay Thakre
 
LAYERS asp.net ppt
LAYERS asp.net pptLAYERS asp.net ppt
LAYERS asp.net ppt
IMEI
 
validation
validationvalidation
validation
teach4uin
 
ASP.NET Session 10
ASP.NET Session 10ASP.NET Session 10
ASP.NET Session 10Sisir Ghosh
 
Chapter 3 (validation control)
Chapter 3 (validation control)Chapter 3 (validation control)
Chapter 3 (validation control)
let's go to study
 
Spring REST Request Validation
Spring REST Request ValidationSpring REST Request Validation
Spring REST Request Validation
Mohammad Sabir Khan
 
ASP.NET Validation Control
ASP.NET Validation ControlASP.NET Validation Control
ASP.NET Validation Control
ZAIYAUL HAQUE
 
Introduction to Custom Form Control
Introduction to Custom Form ControlIntroduction to Custom Form Control
Introduction to Custom Form Control
Knoldus Inc.
 

Similar to Asp.net validation (20)

Validation in asp.net
Validation in asp.netValidation in asp.net
Validation in asp.net
 
Validation controls in asp
Validation controls in aspValidation controls in asp
Validation controls in asp
 
Introduction to validation
Introduction to validationIntroduction to validation
Introduction to validation
 
Asp.NET Validation controls
Asp.NET Validation controlsAsp.NET Validation controls
Asp.NET Validation controls
 
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
 
Validation controls in asp
Validation controls in aspValidation controls in asp
Validation controls in asp
 
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 of aap.net
validation of aap.netvalidation of aap.net
validation of aap.net
 
Validation controls ppt
Validation controls pptValidation controls ppt
Validation controls ppt
 
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
 
LAYERS asp.net ppt
LAYERS asp.net pptLAYERS asp.net ppt
LAYERS asp.net ppt
 
validation
validationvalidation
validation
 
ASP.NET Session 10
ASP.NET Session 10ASP.NET Session 10
ASP.NET Session 10
 
Chapter 3 (validation control)
Chapter 3 (validation control)Chapter 3 (validation control)
Chapter 3 (validation control)
 
2310 b 07
2310 b 072310 b 07
2310 b 07
 
Chapter 9
Chapter 9Chapter 9
Chapter 9
 
Spring REST Request Validation
Spring REST Request ValidationSpring REST Request Validation
Spring REST Request Validation
 
ASP.NET Validation Control
ASP.NET Validation ControlASP.NET Validation Control
ASP.NET Validation Control
 
Introduction to Custom Form Control
Introduction to Custom Form ControlIntroduction to Custom Form Control
Introduction to Custom Form Control
 

More from Paneliya Prince

140120107044 ins ala.ppt
140120107044 ins ala.ppt140120107044 ins ala.ppt
140120107044 ins ala.ppt
Paneliya Prince
 
To create a web service
To create a web serviceTo create a web service
To create a web service
Paneliya Prince
 
Session and state management
Session and state managementSession and state management
Session and state management
Paneliya Prince
 
Managing states
Managing statesManaging states
Managing states
Paneliya Prince
 
Introduction to ado.net
Introduction to ado.netIntroduction to ado.net
Introduction to ado.net
Paneliya Prince
 
Grid view control
Grid view controlGrid view control
Grid view control
Paneliya Prince
 
Asp.net control
Asp.net controlAsp.net control
Asp.net control
Paneliya Prince
 
Wt oep visiting card
Wt oep visiting cardWt oep visiting card
Wt oep visiting card
Paneliya Prince
 
SE OEP online car service booking
SE OEP online car service bookingSE OEP online car service booking
SE OEP online car service booking
Paneliya Prince
 
creating jdbc connection
creating jdbc connectioncreating jdbc connection
creating jdbc connection
Paneliya Prince
 
processing control input
processing control inputprocessing control input
processing control input
Paneliya Prince
 
static dictionary technique
static dictionary techniquestatic dictionary technique
static dictionary technique
Paneliya Prince
 
Ajava oep shopping application
Ajava oep shopping applicationAjava oep shopping application
Ajava oep shopping application
Paneliya Prince
 
creating jdbc connection
creating jdbc connectioncreating jdbc connection
creating jdbc connection
Paneliya Prince
 
static dictionary
static dictionarystatic dictionary
static dictionary
Paneliya Prince
 
ADO.net control
ADO.net controlADO.net control
ADO.net control
Paneliya Prince
 

More from Paneliya Prince (20)

140120107044 ins ala.ppt
140120107044 ins ala.ppt140120107044 ins ala.ppt
140120107044 ins ala.ppt
 
To create a web service
To create a web serviceTo create a web service
To create a web service
 
Session and state management
Session and state managementSession and state management
Session and state management
 
Master pages
Master pagesMaster pages
Master pages
 
Master page
Master pageMaster page
Master page
 
Managing states
Managing statesManaging states
Managing states
 
Introduction to ado.net
Introduction to ado.netIntroduction to ado.net
Introduction to ado.net
 
Grid view control
Grid view controlGrid view control
Grid view control
 
Asp.net control
Asp.net controlAsp.net control
Asp.net control
 
Wt oep visiting card
Wt oep visiting cardWt oep visiting card
Wt oep visiting card
 
SE OEP online car service booking
SE OEP online car service bookingSE OEP online car service booking
SE OEP online car service booking
 
creating jdbc connection
creating jdbc connectioncreating jdbc connection
creating jdbc connection
 
processing control input
processing control inputprocessing control input
processing control input
 
static dictionary technique
static dictionary techniquestatic dictionary technique
static dictionary technique
 
Ajava oep
Ajava oep Ajava oep
Ajava oep
 
Ajava oep shopping application
Ajava oep shopping applicationAjava oep shopping application
Ajava oep shopping application
 
creating jdbc connection
creating jdbc connectioncreating jdbc connection
creating jdbc connection
 
DCDR
DCDRDCDR
DCDR
 
static dictionary
static dictionarystatic dictionary
static dictionary
 
ADO.net control
ADO.net controlADO.net control
ADO.net control
 

Recently uploaded

Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 

Recently uploaded (20)

Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 

Asp.net validation

  • 1. ASP.NET 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: • Required Field Validator • Range Validator • Compare Validator • Regular Expression Validator • Custom Validator • Validation Summary
  • 2. BASE VALIDATOR CLASS The validation control classes are inherited from the BaseValidator class hence they inherit its properties and methods.The properties and the methods of this base class, which are common for all the validation controls:
  • 4. REQUIRED FIELD VALIDATOR 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. The syntax of the control is as given:
  • 5. RANGE VALIDATOR CONTROL  The RangeValidator control verifies that the input value falls within a predetermined range.  It has three specific properties:
  • 6.  The syntax of the control is as given: RANGE VALIDATOR CONTROL
  • 7. COMPARE VALIDATOR 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:
  • 8.  The basic syntax of the control is as follows: COMPARE VALIDATOR CONTROL
  • 9. REGULAR EXPRESSION VALIDATOR  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:
  • 10. Apart from single character match, a class of characters could be specified that can be matched,called the metacharacters. REGULAR EXPRESSION VALIDATOR
  • 11.  Quantifiers could be added to specify number of times a character could appear. REGULAR EXPRESSION VALIDATOR
  • 12.  The syntax of the control is as given: REGULAR EXPRESSION VALIDATOR
  • 13. CUSTOM VALIDATOR  The 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.
  • 14.  The basic syntax for the control is as given: CUSTOM VALIDATOR
  • 15. VALIDATION SUMMARY  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.  The syntax for the control is as given:
  • 16. VALIDATION GROUPS  Complex pages have different groups of information provided in different panels. In such situation, a need might arise for performing validation separately for separate group. This kind of situation is handled using validation groups.  To create a validation group, you should put the input controls and the validation controls into the same logical group by setting their ValidationGroupproperty.