www.acropetal.com vijayalakshmi g m validation controls
TRANSCRIPT
![Page 1: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/1.jpg)
www.acropetal.com
Vijayalakshmi G M
Validation ControlsValidation Controls
![Page 2: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/2.jpg)
ContentsASP.Net Validation Controls OverviewTypes of Validation Controls
![Page 3: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/3.jpg)
ASP.Net Validation Controls - Introduction
![Page 4: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/4.jpg)
Validation Controls - Introduction Validates User input data. It can test for
Missing valuesComparison valuesValues within a range
Ensures that proper data is supplied to processing scripts.
Associated with TextBox control. Automatically performance the test when the
Button, LinkButton, or ImageButton controls are clicked.
![Page 5: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/5.jpg)
Validation ControlsWhen the validation test fails it displays the
error message to the user.User can reenter the value in the text box.
![Page 6: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/6.jpg)
ASP.Net Validation Controls
1. RequiredFieldValidator2. RangeValidator3. CompareValidator4. RegularExpressionValidator5. CustomValidator6. ValidationSummary
![Page 7: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/7.jpg)
ASP.Net Validation Controls
![Page 8: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/8.jpg)
<asp:RequiredFieldValidator> Control Tests the textbox for the missing value and displays
an error message when value is not found Used to Check the Mandatory Fields in the Web
Forms. General format
![Page 9: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/9.jpg)
<asp:RequiredFieldValidator> - Properties
Property Description
ControlToValidate Gives the id of the textbox to be validated.
ErrorMessage It provides text for the error message.
SetFocusOnErrorMessage
Places the cursor in the associated text box.
ValidationGroup Identifies a grouping of TextBox controls to which a set of validation tests applies
![Page 10: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/10.jpg)
<asp:RequiredFieldValidator>
Note:It occupies horizontal space on the page equal to
the length of the error message. The space is preallocated to display the messages.When Display=“Dynamic” property is set the
message space is not preallocated and it will be dynamically set.
![Page 11: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/11.jpg)
<asp:RequiredFieldValidator>
![Page 12: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/12.jpg)
<asp:RangeValidator> Control Tests the value within the range of the value. Values data types
1. Currency (with a dollar sign and commas)2. Date3. Double (floating-point)4. Integer5. String (default).
![Page 13: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/13.jpg)
RangeValidator – General Format
![Page 14: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/14.jpg)
RangeValidator - Properties
1. ControlToValidate 2. ErrorMessage 3. SetFocusOnErrorMessage 4. ValidationGroup Note: Same as RequiredFieldValidator Control1. Type – It specifies the data type.2. MinimumValue – Sets the minimum value 3. MaximumValue – Sets the Maximum value
![Page 15: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/15.jpg)
RangeValidator
![Page 16: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/16.jpg)
<asp:CompareValidator> Compares the given value against a predefined value
based on the comparison operation selected by the user.
The test can be made for the values with following data types.1. Currency (with a dollar sign and commas)2. Date3. Double (floating-point)4. Integer5. String (default).
![Page 17: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/17.jpg)
<asp:CompareValidator>
![Page 18: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/18.jpg)
<asp:CompareValidator>
Property DescriptionOperator Sets the comparison operator.
Value To Compare
It is used to set the target value to be tested.
![Page 19: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/19.jpg)
<asp:CompareValidator>
![Page 20: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/20.jpg)
<asp:CustomValidator> Control This control is used to perform the
additional test (Which cannot performed when used in combinations).
General Format
![Page 21: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/21.jpg)
<asp:CustomValidator> - Properties Basic properties are similar to the
RequiredFieldValidator Control.
Property DescriptionIsValid Set to false to indicate the failure of
the Validation TestOnServerValidate
It calls a subprogram to perform explicitly coded tests. The called subprogram takes the special ServerValidateEventArgs argument.
![Page 22: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/22.jpg)
<asp:CustomValidator> - Properties
![Page 23: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/23.jpg)
Regular Expression Validator
Used to validate complex expressions.The expressions can be
phone numberemail addresszip code and many more.
Set the ValidationExpression property to any type of expression OR
Create the custom expression to validate the data.
![Page 24: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/24.jpg)
Regular Expression Validator
![Page 25: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/25.jpg)
Regular Expression Validator
![Page 26: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/26.jpg)
<asp:ValidationSummary>
The individual error messages generated by separate controls can be displayed together.
It can limit its error reporting to an identified set of grouped controls.
![Page 27: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/27.jpg)
<asp:ValidationSummary> General Format
Example
![Page 28: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/28.jpg)
<asp:ValidationSummary>
DisplayMode – Sets the display mode for the of the error summary.
ShowMessageBox – Display the error messages in the form of a message box.
ShowSummary – It suppresses the display of the error message on the page.
![Page 29: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/29.jpg)
<asp:ValidationSummary>
![Page 30: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/30.jpg)
Resource
![Page 31: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/31.jpg)
Resources
ASP.Net Validation Controlshttp://quickstarts.asp.net/QuickStartv20/aspnet/
doc/ctrlref/validation/validationsummary.aspxhttp://devhood.com/Tutorials/tutorial_details.asp
x?tutorial_id=46http://msdn.microsoft.com/en-us/library/aa4790
45.aspx
![Page 32: Www.acropetal.com Vijayalakshmi G M Validation Controls](https://reader036.vdocuments.mx/reader036/viewer/2022081504/5697c02a1a28abf838cd8308/html5/thumbnails/32.jpg)
Thank You