SlideShare a Scribd company logo
Introducing Validation Controls by PRAVEEN NANDAGIRI
Agenda How do we define Validation Controls Compare Validator Range Validator Regular Expression Validator Required Field Validator Custom Validator Validation Summary
Validation Server Controls Validation server controls are used to validate the data of an input control. If the data does not pass validation, it will display an error message to the user. The syntax for creating a Validation server control is: <asp:control_name id=&quot;some_id&quot; runat=&quot;server&quot; />
1)Compare Validator Compares the value of one input control to the value of another input control or to a fixed value If the input control is empty, at first time (after page load )the validation will succeed. So it does not give any error message .that's why at first we give input to that  control i.e., which control assigns compare validator .Use the RequiredFieldValidator control to make the field required . The main properties of Compare validator is Id : A unique id for the control ControlToCompare : The name of the control to compare with ControlToValidate : The id of the control to validate
ErrorMessage : The text to display in the ValidationSummary control when validation fails. This text will also be displayed in the validation control if the Text property is not set Text : The message to display when validation fails ValueToCompare : A specified value to compare with Type : Specifies the data type of the values to compare. Types are Currency Date Double Integer String
2) Range Validator The RangeValidator control is used to check that the user enters an  input value that falls between two values. It is possible to check ranges within numbers, dates, and characters. The validation will not fail if the input control is empty. Use the RequiredFieldValidator control to make the field required. The main properties are  ControlToValidate :  The id of the control to validate ErrorMessage : The text to display in the ValidationSummary  control when validation fails. Note:  This text(Error message) will also be displayed in the validation control if the Text property is not set
Id : A unique id for the control MaximumValue : Specifies the maximum value of the input control MinimumValue : Specifies the minimum value of the input control Text :  The message to display when validation fails Display : The display behavior for the validation control. Legal values are:  None (the control is not displayed. Used to show the error message only in the ValidationSummary control) Static (the control displays an error message if validation fails. Space is reserved on the page for the message even if the input passes validation.) Dynamic (the control displays an error message if validation fails. Space is not reserved on the page for the message if the input passes validation)
Type : Specifies the data type of the value to check. The types are:  Currency Date Double Integer String
3)Regular Expression Validator The RegularExpressionValidator control is used to ensure that an input value matches a specified pattern. Both server and client-side validation are performed unless the browser does not support client-side validation or the EnableClientScript property is set to false. The main properties of this control are Id : A unique id for the control ControlToValidate  : The id of the control to validate Display : The display behavior for the validation control.
Legal values are: None (the control is not displayed. Used to show the error message only in the ValidationSummary control) Static (the control displays an error message if validation fails. Space is reserved on the page for the message even if the input passes validation.) Dynamic (the control displays an error message if validation fails. Space is not reserved on the page for the message if the input passes validation) ErrorMessage :  The text to display in the ValidationSummary control when validation fails.  Note:  This text will also be displayed in the validation control if the Text property is not set
Text : The message to display when validation fails ValidationExpression : Specifies the expression used to validate input control. The expression validation syntax is different on the client than on the server. JScript is used on the client. On the server, the language you have specified is used
4)RequiredFieldValidator The RequiredFieldValidator control is used to make an input control a required field. With this control, the validation fails if the input value does not change from its initial value. By default, the initial value is an empty string (&quot;&quot;). Leading and trailing spaces of the input value are removed before validation. The InitialValue property does not set the default value for the input control. It indicates the value that you do  not  want the user to enter in the input control.
The main properties of the Required field validator is  Id : A unique id for the control ControlToValidate : The id of the control to validate Display : The display behavior for the validation control.  Legal values are  None (the control is not displayed. Used to show the error message only in the ValidationSummary control) Static (the control displays an error message if validation fails. Space is reserved on the page for the message even if the input passes validation.) Dynamic (the control displays an error message if validation fails. Space is not reserved on the page for the message if the input passes validation)
ErrorMessage : The text to display in the ValidationSummary control when validation fails.  Note:  This text will also be displayed in the validation control if the Text property is not set InitialValue : Specifies the starting value of the input control. Default value is ““(nothing). Text : The message to display when validation fails
5) CustomValidator The CustomValidator control allows you to write a method to handle the validation of the value entered. The main properties of the CustomValidator Control are Id : A unique id for the control ClientValidationFunction : Specifies the name of the client-side validation script function to be executed.  Note:  The script must be in a language that the browser supports, such as VBScript or JScript (Java Script). With  VBScript, the function must be in the form: Sub FunctionName (source, arguments) With JScript, the function must be in the form: Function FunctionName (source, arguments) ControlToValidate : The id of the control to validate
ErrorMessage : The text to display in the ValidationSummary control when validation fails.  Note:  This text will also be displayed in the validation control if the Text property is not set Text : The message to display when validation fails Display : The display behavior for the validation control. Legal values are:  None (the control is not displayed. Used to show the error message only in the ValidationSummary control) Static (the control displays an error message if validation fails. Space is reserved on the page for the message even if the input passes validation. Dynamic (the control displays an error message if validation fails. Space is not reserved on the page for the message if the input passes validation
6)Validation Summary The ValidationSummary control is used to display a summary of all validation errors occurred in a Web page. The error message displayed in this control is specified by the ErrorMessage property of each validation control. If the ErrorMessage property of the validation control is not set, no error message is displayed for that validation control. The main properties of Validtion summary are  DisplayMode : How to display the summary.
Legal values are:  BulletList List SingleParagraph HeaderText : A header in the ValidationSummary control Id  :  A unique id for the control ShowMessageBox : A Boolean value that specifies whether the summary should be displayed in a message box or not ShowSummary : A Boolean value that specifies whether the ValidationSummary control should be displayed or hidden Ref URL : http://anildiggiwal.blogspot.com/2011/01/validation-server-controls.html
Thank You !

More Related Content

What's hot (20)

PPTX
Validation controls in asp
KS Technologies Vadodara
 
PPTX
validations in asp .net
Akshay Thakre
 
PPT
ASP.NET Session 10
Sisir Ghosh
 
PPTX
Chapter 9
application developer
 
PPTX
Introduction to validation
rlavadiya
 
PDF
Chapter 3 (validation control)
let's go to study
 
PDF
What are Anypoint Validations With Mulesoft
Jitendra Bafna
 
PPT
Controls
Iblesoft
 
PPT
Wcf routing kt
Krunal Trivedi
 
PDF
Angular performance improvments
Eliran Eliassy
 
DOC
Wheels
guest9fd0a95
 
PPT
Jquery validate - TuanNA
Framgia Vietnam
 
PDF
Clean VIP (Clean Swift) architecture
Jianbin LIN
 
PDF
Angular genericforms2
Eliran Eliassy
 
PPT
IBM Performance Optimizaiton Toolkit for Rational Performance Tester
Ashish Patel
 
PDF
Introduction To Angular's reactive forms
Nir Kaufman
 
PDF
Advanced Rational Performance Tester reports
Bill Duncan
 
DOCX
Html forms
Abhishek Kesharwani
 
PDF
Client side scripting
Eleonora Ciceri
 
DOCX
Java script
shamim hasan
 
Validation controls in asp
KS Technologies Vadodara
 
validations in asp .net
Akshay Thakre
 
ASP.NET Session 10
Sisir Ghosh
 
Introduction to validation
rlavadiya
 
Chapter 3 (validation control)
let's go to study
 
What are Anypoint Validations With Mulesoft
Jitendra Bafna
 
Controls
Iblesoft
 
Wcf routing kt
Krunal Trivedi
 
Angular performance improvments
Eliran Eliassy
 
Wheels
guest9fd0a95
 
Jquery validate - TuanNA
Framgia Vietnam
 
Clean VIP (Clean Swift) architecture
Jianbin LIN
 
Angular genericforms2
Eliran Eliassy
 
IBM Performance Optimizaiton Toolkit for Rational Performance Tester
Ashish Patel
 
Introduction To Angular's reactive forms
Nir Kaufman
 
Advanced Rational Performance Tester reports
Bill Duncan
 
Client side scripting
Eleonora Ciceri
 
Java script
shamim hasan
 

Similar to Validation controls ppt (20)

PPTX
vnd.openxmlformats-officedocument.presentationml.presentation&rendition=1.pptx
YamunaS38
 
PPT
2310 b 07
Krazy Koder
 
PDF
validation-controls.pdf ioue8n uoh souu o3i
CoRRexGaMing
 
PPTX
validation of aap.net
Pratiksha Srivastava
 
PPTX
LAYERS asp.net ppt
IMEI
 
PDF
Introduction to Custom Form Control
Knoldus Inc.
 
PPTX
Project1 CS
sunmitraeducation
 
ODP
Rpt ppt
sindhu T
 
PDF
JavaScript - Chapter 14 - Form Handling
WebStackAcademy
 
PDF
Murach: How to validate data in asp.net core mvc
MahmoudOHassouna
 
PPTX
Project1 VB
sunmitraeducation
 
PDF
Rc085 010d-vaadin7
Cosmina Ivan
 
PDF
Mastering Assertions in Automation Testing, Importance and Best Practices.pdf
pcloudy2
 
PPTX
Form Validation in JavaScript
Ravi Bhadauria
 
PDF
AuditGen: Operational Audit Features
CC Expertise
 
PPT
ASP.NET 03 - Working With Web Server Controls
Randy Connolly
 
PPTX
Ajax control tool kit
Vidhi Patel
 
PDF
OLT open script
Sujay Raghuraj
 
PPT
Application Security:
Shivaami Corporation
 
vnd.openxmlformats-officedocument.presentationml.presentation&rendition=1.pptx
YamunaS38
 
2310 b 07
Krazy Koder
 
validation-controls.pdf ioue8n uoh souu o3i
CoRRexGaMing
 
validation of aap.net
Pratiksha Srivastava
 
LAYERS asp.net ppt
IMEI
 
Introduction to Custom Form Control
Knoldus Inc.
 
Project1 CS
sunmitraeducation
 
Rpt ppt
sindhu T
 
JavaScript - Chapter 14 - Form Handling
WebStackAcademy
 
Murach: How to validate data in asp.net core mvc
MahmoudOHassouna
 
Project1 VB
sunmitraeducation
 
Rc085 010d-vaadin7
Cosmina Ivan
 
Mastering Assertions in Automation Testing, Importance and Best Practices.pdf
pcloudy2
 
Form Validation in JavaScript
Ravi Bhadauria
 
AuditGen: Operational Audit Features
CC Expertise
 
ASP.NET 03 - Working With Web Server Controls
Randy Connolly
 
Ajax control tool kit
Vidhi Patel
 
OLT open script
Sujay Raghuraj
 
Application Security:
Shivaami Corporation
 
Ad

More from Iblesoft (16)

PPT
Ms sql server ii
Iblesoft
 
PPT
MS SQL Server 1
Iblesoft
 
PPTX
Master pages ppt
Iblesoft
 
DOCX
State management
Iblesoft
 
PPTX
State management
Iblesoft
 
PPT
Ado.net
Iblesoft
 
PPT
Generics n delegates
Iblesoft
 
PPT
Ajaxppt
Iblesoft
 
PPT
Data controls ppt
Iblesoft
 
PPTX
Microsoft.net architecturte
Iblesoft
 
PPT
Asp.net architecture
Iblesoft
 
PPTX
Generics
Iblesoft
 
PPTX
Delegates and events
Iblesoft
 
PPT
Javascript
Iblesoft
 
PPT
Html ppt
Iblesoft
 
PPT
Exception handling
Iblesoft
 
Ms sql server ii
Iblesoft
 
MS SQL Server 1
Iblesoft
 
Master pages ppt
Iblesoft
 
State management
Iblesoft
 
State management
Iblesoft
 
Ado.net
Iblesoft
 
Generics n delegates
Iblesoft
 
Ajaxppt
Iblesoft
 
Data controls ppt
Iblesoft
 
Microsoft.net architecturte
Iblesoft
 
Asp.net architecture
Iblesoft
 
Generics
Iblesoft
 
Delegates and events
Iblesoft
 
Javascript
Iblesoft
 
Html ppt
Iblesoft
 
Exception handling
Iblesoft
 
Ad

Recently uploaded (20)

PDF
Geographical Diversity of India 100 Mcq.pdf/ 7th class new ncert /Social/Samy...
Sandeep Swamy
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PPTX
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PPTX
GRADE-3-PPT-EVE-2025-ENG-Q1-LESSON-1.pptx
EveOdrapngimapNarido
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PPTX
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PPTX
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
Geographical Diversity of India 100 Mcq.pdf/ 7th class new ncert /Social/Samy...
Sandeep Swamy
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
GRADE-3-PPT-EVE-2025-ENG-Q1-LESSON-1.pptx
EveOdrapngimapNarido
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 

Validation controls ppt

  • 1. Introducing Validation Controls by PRAVEEN NANDAGIRI
  • 2. Agenda How do we define Validation Controls Compare Validator Range Validator Regular Expression Validator Required Field Validator Custom Validator Validation Summary
  • 3. Validation Server Controls Validation server controls are used to validate the data of an input control. If the data does not pass validation, it will display an error message to the user. The syntax for creating a Validation server control is: <asp:control_name id=&quot;some_id&quot; runat=&quot;server&quot; />
  • 4. 1)Compare Validator Compares the value of one input control to the value of another input control or to a fixed value If the input control is empty, at first time (after page load )the validation will succeed. So it does not give any error message .that's why at first we give input to that control i.e., which control assigns compare validator .Use the RequiredFieldValidator control to make the field required . The main properties of Compare validator is Id : A unique id for the control ControlToCompare : The name of the control to compare with ControlToValidate : The id of the control to validate
  • 5. ErrorMessage : The text to display in the ValidationSummary control when validation fails. This text will also be displayed in the validation control if the Text property is not set Text : The message to display when validation fails ValueToCompare : A specified value to compare with Type : Specifies the data type of the values to compare. Types are Currency Date Double Integer String
  • 6. 2) Range Validator The RangeValidator control is used to check that the user enters an input value that falls between two values. It is possible to check ranges within numbers, dates, and characters. The validation will not fail if the input control is empty. Use the RequiredFieldValidator control to make the field required. The main properties are ControlToValidate : The id of the control to validate ErrorMessage : The text to display in the ValidationSummary control when validation fails. Note: This text(Error message) will also be displayed in the validation control if the Text property is not set
  • 7. Id : A unique id for the control MaximumValue : Specifies the maximum value of the input control MinimumValue : Specifies the minimum value of the input control Text : The message to display when validation fails Display : The display behavior for the validation control. Legal values are: None (the control is not displayed. Used to show the error message only in the ValidationSummary control) Static (the control displays an error message if validation fails. Space is reserved on the page for the message even if the input passes validation.) Dynamic (the control displays an error message if validation fails. Space is not reserved on the page for the message if the input passes validation)
  • 8. Type : Specifies the data type of the value to check. The types are: Currency Date Double Integer String
  • 9. 3)Regular Expression Validator The RegularExpressionValidator control is used to ensure that an input value matches a specified pattern. Both server and client-side validation are performed unless the browser does not support client-side validation or the EnableClientScript property is set to false. The main properties of this control are Id : A unique id for the control ControlToValidate : The id of the control to validate Display : The display behavior for the validation control.
  • 10. Legal values are: None (the control is not displayed. Used to show the error message only in the ValidationSummary control) Static (the control displays an error message if validation fails. Space is reserved on the page for the message even if the input passes validation.) Dynamic (the control displays an error message if validation fails. Space is not reserved on the page for the message if the input passes validation) ErrorMessage : The text to display in the ValidationSummary control when validation fails. Note: This text will also be displayed in the validation control if the Text property is not set
  • 11. Text : The message to display when validation fails ValidationExpression : Specifies the expression used to validate input control. The expression validation syntax is different on the client than on the server. JScript is used on the client. On the server, the language you have specified is used
  • 12. 4)RequiredFieldValidator The RequiredFieldValidator control is used to make an input control a required field. With this control, the validation fails if the input value does not change from its initial value. By default, the initial value is an empty string (&quot;&quot;). Leading and trailing spaces of the input value are removed before validation. The InitialValue property does not set the default value for the input control. It indicates the value that you do not want the user to enter in the input control.
  • 13. The main properties of the Required field validator is Id : A unique id for the control ControlToValidate : The id of the control to validate Display : The display behavior for the validation control. Legal values are None (the control is not displayed. Used to show the error message only in the ValidationSummary control) Static (the control displays an error message if validation fails. Space is reserved on the page for the message even if the input passes validation.) Dynamic (the control displays an error message if validation fails. Space is not reserved on the page for the message if the input passes validation)
  • 14. ErrorMessage : The text to display in the ValidationSummary control when validation fails. Note: This text will also be displayed in the validation control if the Text property is not set InitialValue : Specifies the starting value of the input control. Default value is ““(nothing). Text : The message to display when validation fails
  • 15. 5) CustomValidator The CustomValidator control allows you to write a method to handle the validation of the value entered. The main properties of the CustomValidator Control are Id : A unique id for the control ClientValidationFunction : Specifies the name of the client-side validation script function to be executed. Note: The script must be in a language that the browser supports, such as VBScript or JScript (Java Script). With VBScript, the function must be in the form: Sub FunctionName (source, arguments) With JScript, the function must be in the form: Function FunctionName (source, arguments) ControlToValidate : The id of the control to validate
  • 16. ErrorMessage : The text to display in the ValidationSummary control when validation fails. Note: This text will also be displayed in the validation control if the Text property is not set Text : The message to display when validation fails Display : The display behavior for the validation control. Legal values are: None (the control is not displayed. Used to show the error message only in the ValidationSummary control) Static (the control displays an error message if validation fails. Space is reserved on the page for the message even if the input passes validation. Dynamic (the control displays an error message if validation fails. Space is not reserved on the page for the message if the input passes validation
  • 17. 6)Validation Summary The ValidationSummary control is used to display a summary of all validation errors occurred in a Web page. The error message displayed in this control is specified by the ErrorMessage property of each validation control. If the ErrorMessage property of the validation control is not set, no error message is displayed for that validation control. The main properties of Validtion summary are DisplayMode : How to display the summary.
  • 18. Legal values are: BulletList List SingleParagraph HeaderText : A header in the ValidationSummary control Id : A unique id for the control ShowMessageBox : A Boolean value that specifies whether the summary should be displayed in a message box or not ShowSummary : A Boolean value that specifies whether the ValidationSummary control should be displayed or hidden Ref URL : http://anildiggiwal.blogspot.com/2011/01/validation-server-controls.html