SlideShare ist ein Scribd-Unternehmen logo
1 von 8
BY-Teach4u.in
Today
What Validation controls do
Benefits & Limitations
Six Validation Controls
Implementation Example
What Validation Controls Do
Each control:
Validates user inputs on client-side using JavaScript
 When possible
Validates all inputs on server
Writes client-side error message if invalid
Benefits and Limitations
Benefits
Convenience
 Cut & paste
Bomb-proof
 Server-side validation
Limitations
Must remember to check on server
 Page.IsValid statement
Six Validation Controls
1. RequiredFieldValidator
 Only validator that checks for NO entry
1. CompareValidator
 Compares input to: datatype, constant, another
control, database value, etc.
1. RangeValidator
 Entry within a specified data range
Six Validation Controls
4. RegularExpressionValidator
 Check format against a specific pattern
 E-mail address, phone number, zip code, etc.
4. CustomValidator
 Write own code
 Server- or client-side
4. ValidationSummary
 Summarizes all errors on page
Implementation
 Often need > 1 validator per input
 Only RequiredFieldValidator checks for empty fields
 Page.IsValid
 Check in event handler
 if (!Page.IsValid) return;
 Validation Groups
 Allow validation controls to be assigned to groups
 Page can have several groups
 Act independently
 Only group associated with postback event must have valid entries
 Example: No groups, groups
 Example:
 Required, Compare, Range,
& Custom (client- and server-side script)
 Validation.aspx (source)
Summary
Easy to use
Flexible
Validate any type of input
Combines client- and server-side validation in one
control
Bomb-proof server-side validation

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to software testing
Introduction to software testingIntroduction to software testing
Introduction to software testing
Abhishek Saxena
 
ASP.NET Session 10
ASP.NET Session 10ASP.NET Session 10
ASP.NET Session 10
Sisir Ghosh
 

Was ist angesagt? (17)

validations in asp .net
validations in asp .netvalidations in asp .net
validations in asp .net
 
Validation controls in asp
Validation controls in aspValidation controls in asp
Validation controls in asp
 
Angular Form Validations
Angular Form ValidationsAngular Form Validations
Angular Form Validations
 
Overview of Testing in RMsis
Overview of Testing in RMsisOverview of Testing in RMsis
Overview of Testing in RMsis
 
Introduction to software testing
Introduction to software testingIntroduction to software testing
Introduction to software testing
 
AppSight 5.0 Advanced Concepts Training
AppSight 5.0 Advanced Concepts TrainingAppSight 5.0 Advanced Concepts Training
AppSight 5.0 Advanced Concepts Training
 
Approval Process in Salesforce
Approval Process in SalesforceApproval Process in Salesforce
Approval Process in Salesforce
 
P04 - Vendor Management (MCU)
P04 - Vendor Management (MCU) P04 - Vendor Management (MCU)
P04 - Vendor Management (MCU)
 
Introduction to validation
Introduction to validationIntroduction to validation
Introduction to validation
 
Jquery validate - TuanNA
Jquery validate - TuanNAJquery validate - TuanNA
Jquery validate - TuanNA
 
ASP.NET Session 10
ASP.NET Session 10ASP.NET Session 10
ASP.NET Session 10
 
Tool Evaluation
Tool EvaluationTool Evaluation
Tool Evaluation
 
WilmaVER
WilmaVERWilmaVER
WilmaVER
 
Approval process
Approval processApproval process
Approval process
 
Testcase
TestcaseTestcase
Testcase
 
Sequnce diagram for ONLINE EXAMINATION SYSTEM
Sequnce diagram for ONLINE EXAMINATION SYSTEMSequnce diagram for ONLINE EXAMINATION SYSTEM
Sequnce diagram for ONLINE EXAMINATION SYSTEM
 
Automation Testing and its importance
Automation Testing and its importanceAutomation Testing and its importance
Automation Testing and its importance
 

Andere mochten auch (6)

Controls
ControlsControls
Controls
 
L18 applets
L18 appletsL18 applets
L18 applets
 
Java Programming- Introduction to Java Applet Programs
Java Programming- Introduction to Java Applet ProgramsJava Programming- Introduction to Java Applet Programs
Java Programming- Introduction to Java Applet Programs
 
Identifying the Inquiry and Stating the Problem
Identifying the Inquiry and Stating the ProblemIdentifying the Inquiry and Stating the Problem
Identifying the Inquiry and Stating the Problem
 
6.applet programming in java
6.applet programming in java6.applet programming in java
6.applet programming in java
 
27 applet programming
27  applet programming27  applet programming
27 applet programming
 

Ähnlich wie validation

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
 
Performance testing for web applications – techniques, metrics and profiling
Performance testing for web applications – techniques, metrics and profilingPerformance testing for web applications – techniques, metrics and profiling
Performance testing for web applications – techniques, metrics and profiling
TestCampRO
 

Ähnlich wie validation (20)

validation
validationvalidation
validation
 
2310 b 07
2310 b 072310 b 07
2310 b 07
 
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.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
 
Chapter 3 (validation control)
Chapter 3 (validation control)Chapter 3 (validation control)
Chapter 3 (validation control)
 
Chapter 9
Chapter 9Chapter 9
Chapter 9
 
Acceptance Test Driven Development at StarWest 2014
Acceptance Test Driven Development at StarWest 2014Acceptance Test Driven Development at StarWest 2014
Acceptance Test Driven Development at StarWest 2014
 
Sw testing and qa basics
Sw testing and qa basicsSw testing and qa basics
Sw testing and qa basics
 
Performance testing for web applications – techniques, metrics and profiling
Performance testing for web applications – techniques, metrics and profilingPerformance testing for web applications – techniques, metrics and profiling
Performance testing for web applications – techniques, metrics and profiling
 
Test Automation Frameworks Final
Test Automation Frameworks   FinalTest Automation Frameworks   Final
Test Automation Frameworks Final
 
Do’s and don’ts of api testing
Do’s and don’ts of api testingDo’s and don’ts of api testing
Do’s and don’ts of api testing
 
MVC 3-RAZOR Validation
MVC 3-RAZOR ValidationMVC 3-RAZOR Validation
MVC 3-RAZOR Validation
 
Emag
EmagEmag
Emag
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDD
 
What are Anypoint Validations With Mulesoft
What are Anypoint Validations With Mulesoft What are Anypoint Validations With Mulesoft
What are Anypoint Validations With Mulesoft
 
Client Side Scripting.pptx
Client Side Scripting.pptxClient Side Scripting.pptx
Client Side Scripting.pptx
 
Rpt ppt
Rpt pptRpt ppt
Rpt ppt
 
software testing technique
software testing techniquesoftware testing technique
software testing technique
 
Form Validation in JavaScript
Form Validation in JavaScriptForm Validation in JavaScript
Form Validation in JavaScript
 

Mehr von teach4uin (20)

Master pages
Master pagesMaster pages
Master pages
 
.Net framework
.Net framework.Net framework
.Net framework
 
Scripting languages
Scripting languagesScripting languages
Scripting languages
 
Css1
Css1Css1
Css1
 
Code model
Code modelCode model
Code model
 
Asp db
Asp dbAsp db
Asp db
 
State management
State managementState management
State management
 
security configuration
security configurationsecurity configuration
security configuration
 
static dynamic html tags
 static dynamic html tags static dynamic html tags
static dynamic html tags
 
static dynamic html tags
static dynamic html tagsstatic dynamic html tags
static dynamic html tags
 
New microsoft office power point presentation
New microsoft office power point presentationNew microsoft office power point presentation
New microsoft office power point presentation
 
.Net overview
.Net overview.Net overview
.Net overview
 
Stdlib functions lesson
Stdlib functions lessonStdlib functions lesson
Stdlib functions lesson
 
enums
enumsenums
enums
 
memory
memorymemory
memory
 
array
arrayarray
array
 
storage clas
storage classtorage clas
storage clas
 
Cprogrammingprogramcontrols
CprogrammingprogramcontrolsCprogrammingprogramcontrols
Cprogrammingprogramcontrols
 
Cprogrammingoperator
CprogrammingoperatorCprogrammingoperator
Cprogrammingoperator
 
3 data-types-in-c
3 data-types-in-c3 data-types-in-c
3 data-types-in-c
 

Kürzlich hochgeladen

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 

Kürzlich hochgeladen (20)

Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
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)
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
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.
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 

validation

  • 2. Today What Validation controls do Benefits & Limitations Six Validation Controls Implementation Example
  • 3. What Validation Controls Do Each control: Validates user inputs on client-side using JavaScript  When possible Validates all inputs on server Writes client-side error message if invalid
  • 4. Benefits and Limitations Benefits Convenience  Cut & paste Bomb-proof  Server-side validation Limitations Must remember to check on server  Page.IsValid statement
  • 5. Six Validation Controls 1. RequiredFieldValidator  Only validator that checks for NO entry 1. CompareValidator  Compares input to: datatype, constant, another control, database value, etc. 1. RangeValidator  Entry within a specified data range
  • 6. Six Validation Controls 4. RegularExpressionValidator  Check format against a specific pattern  E-mail address, phone number, zip code, etc. 4. CustomValidator  Write own code  Server- or client-side 4. ValidationSummary  Summarizes all errors on page
  • 7. Implementation  Often need > 1 validator per input  Only RequiredFieldValidator checks for empty fields  Page.IsValid  Check in event handler  if (!Page.IsValid) return;  Validation Groups  Allow validation controls to be assigned to groups  Page can have several groups  Act independently  Only group associated with postback event must have valid entries  Example: No groups, groups  Example:  Required, Compare, Range, & Custom (client- and server-side script)  Validation.aspx (source)
  • 8. Summary Easy to use Flexible Validate any type of input Combines client- and server-side validation in one control Bomb-proof server-side validation