Home
Technical Training
ASP.NET Training
ASP .NET: Validating User Input with C#
Required Field Validator
Regular Expression Validator
Range Validator
Compare Validator
Custom Validator
Validation Summary Control
This tutorial is part of a ASP.NET Training tutorial series. Read it from the beginning and learn yourself.
Technical Training
ASP.NET TrainingTable of Contents
ASP .NET: Validating User Input with C#
Required Field Validator
Regular Expression Validator
Range Validator
Compare Validator
Custom Validator
Validation Summary ControlRange Validator
Page 4 of 7
Author : Exforsys Inc. Published on: 4th Mar 2005 | Last Updated on: 18th Dec 2010
ASP .NET: Validating User Input with C#
The Range Validator control is used to check whether the input control contains value in the specified range. You can check the range of values against different data types such as String, Date, Integer and so on.
The two most important properties of the range validator control is the Maximum value and the minimum value. The range can be used when you need to restrict the user data.
Ads
Suppose you want the user to enter the number in the TextBox which is between 20 and 25 you can use range validator mimimum and maximum properties to restrict the user input.
Sample Code
- if(Page.IsValid == true)
- {
- RangeValidator1.MinimumValue = 20;
- RangeValidator1.MaximumValue = 25;
- }
Copyright exforsys.com
Read Next: Using Rich Server Controls with C#
ASP.NET Training
- ASP.NET with C# Training Launch
- ASP.NET with C# Training Course Outline
- Introduction to ASP.NET with C#
- ASP.NET Web Forms Controls
- ASP .NET: Validating User Input with C#
- Using Rich Server Controls with C#
- Accessing Data with C#
- ASP.NET Using the DataList and Repeater, Datagrid Controls
- Managing Data with ADO.NET DataSets and C#
- Creating and consuming XML Web Services with C#
- ASP .NET Migration and Interoperability
- Managing State with ASP.NET and C#
- Caching in ASP.NET
- Configuring and Deploying ASP.NET Applications
- Securing ASP.NET Applications with C#







