ASP.NET : ValidationSummary

ValidationSummary
This control use to show error messages of each Validation as a List or MessageBox.

ValidationSummary Properties
DisplayMode: Type of display error massage as a List, Bullet List or Single paragraph.
ShowMessageBox: Select "True" Display error massage as a MessageBox.
ShowSummary: Select "True" Display error massage as List at bottom of the page.

Other Validator Properties
Display: Select "None" to not display error message except in ValidationSummary.

Example
1. Create a ASP.NET website then add Standard TextBox, Validator and ValidationSummary. Need 2 or above Validation (See Example in Figure 1).


Figure 1: Example 

2. Select your ValidationSummary and set some properties that you want (This Example will show error message only in MessageBox (see Figure 1))

ValidationSummary PropertiesValue
DisplayModeList
ShowMessageBoxTrue
ShowSummaryFalse

Other Validator PropertiesValue
DisplayNone
Table 1: Example Properties

3. Test your application you will see error message only in MessageBox (Figure 2).

Figure 2: Example Application

##############################

 RequiredFieldValidator << Previous Chapter

ASP.NET : RequiredFieldValidator

RequiredFieldValidator 
This control not allow user skip an entry.

Example
1. Create a ASP.NET website then add Standard TextBox and RequiredFieldValidator.
2. Select your RangeValidator and set require properties for validate (see Table 1).


PropertiesValue
ControlToValidateTextBox1
ErrorMassagePlease Input Name !!

Table 1: Require Properties for RequiredFieldValidator

3. Test your application you will see error message when you don't entry anything in TextBox1 (Figure 1).


Figure 1: Require Check  Example

##############################

RangeValidaton << Previous Chapter || Next Chapter >> ValidationSummary

ASP.NET : RangeValidator

RangeValidator 
Check a number ranges with minimum and maximum number, alphabetic and Date.


Properties
Maximum Value: Highest value that you want to check.
Minimum Value: Lowest value that you want to check.
Type: Which Data Type that you want to check.


Example
1. Create a ASP.NET website then add Standard TextBox and RangeValidator.
2. Select your RangeValidatorand set require properties for validate (see Table 1).


PropertiesValue
ControlToValidateTextBox1
ErrorMassageYou are not 18-50 years old !!
MamimumValue50
MinimumValue18
TypeInteger

Table 1: Require Properties for RangeValidator


3. Test your application you will see error message when you input value that not in range (Figure 1).

Shorty Bluejova, Open Learning, Programming

Figure 1: Range Check  Example

##############################

CustomValidator << Previous Chapter || Next Chapter >> RequiredFieldValidator
Related Posts Plugin for WordPress, Blogger...