1. ASP.NET Introduction 2. Comp of .Net Framework 3.5 3. Sys.Req for VS 2008 4. ASP.NET Envrmnt Setup 5. VS2010 Ultimate Sys.Req 6. Installing VS 2010 7. VS 2012 Sys.Req 8. Installing VS Exp 2012 9. Start the VS 2008 10. Application Life Cycle 11. Page Life Cycle 12. Page Life Cycle Events 13. ASP.NET Example 14. Event Handling 15. Default Events 16. Server Side 17. Request Object 18. Response Object 19. Server Controls 20. Server Controls Properties 21. Server Controls Methods 22. HTML Server Controls 23. Client Side 24. ASP.NET Basic Controls 25. TextBox Control 26. CheckBox Controls 27. RadioButton Controls 28. ListBox Control 29. HyperLink Control 30. Image Control 31. BulletedList Control 32. ASP.NET Directives 33. Implements Directive 34. Master Type Directive 35. Page Directive 36. PreviousPage Type 37. Managing State 38. Control State 39. Cookies 40. Query Strings 41. Server-Side State 42. Session State 43. Validation Controls 44. Required FieldValidator 45. Range Validator 46. Compare Validator 47. RegularExpressionValidator 48. Custom Validator 49. Validation Summary 50. Data Source Control 51. AdRotator Control 52. Calendar Control 53. Calendar Control Example 54. Panel Control 55. Panel Control Example 56. Multi Views Control 57. MultiView & View controls 58. MultiView Control Example 59. FileUpload Control 60. FileUpload Control Eg 61. AJAX Control 62. UpdatePanel control 63. UpdateProgress Control 64. Custom Controls 65. Custom Control Eg 66. Personalization 67. Create Simple Profile 68. ADO.NET 69. ADO.NET Objects 70. DataTable 71. DataRow 72. DataColumn 73. Object Example 74. Error Handling 75. Tracing Errors 76. Debugger 77. Security 78. Authentication 79. Authorization 80. LINQ 81. LINQ Query Operators 82. LINQ Example 83. Caching 84. Data Caching 85. Output Caching 86. Object Caching 87. Web Services 88. Create Web Services Eg 89. Web & Machine.config 90. Settings Schema 91. ASP.NET Deployment 92. XCopy Deployment 93. Web Setup Project 94. ASP Interview Part 1 95. ASP Interview Part 2 96. ASP Interview Part 3 97. ASP Interview Part 4 98. ASP Interview Part 5 99. ASP Interview Part 6
Pr.Pg Next Pg

2. The RangeValidator tutorials

  • The RangeValidator control enables you to check whether a value falls within a certain range.

  • The control is able to check data types like strings, numbers, dates, and currencies.

  • For example, you can use it to make sure a number is between 1 and 10, or a selected date falls between today and the next two weeks.

  • The following table lists its most important properties.





This property determines the lowest acceptable value. For example, when checking an integer number between 1 and 10, you set this property to 1.


This property determines the highest acceptable value. For example, when checking an integer number between 1 and 10, you set this property to 10.


This property determines the data type that the validation control checks.This value can be set to String, Integer, Double, Date, or Currency to check the respective data types.


This property sets the identifier for the control. This Identifier is used via programming to access the control's Properties. If an identifier does not exist, then you cannot Write handlers for this control.


This property sets the ID of the control that specifies the maximum value of the validation range.


This property sets the ID of the control that specifies the minimum value of the validation range.


Specifies that this control runs on the server


RangeValidatorExmp.aspx.cs Code:



Following example shows the use of ASP.NET RangeValidator.

Sam Sir


using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;


public partial class RangeValidatorExmp : System.Web.UI.Page


protected void Page_Load(object sender, EventArgs e)







RangeValidatorExmp.aspx Code:


Following example shows the use of ASP.NET RangeValidator.

Sam Sir


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RangeValidatorExmp.aspx.cs" Inherits="RangeValidatorExmp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">

<head runat="server">

<title>cbtSAM ASP.NET Range Validator Example</title>

<style type="text/css">



width: 100%;





<form id="form1" runat="server">


<table class="style1">





cbtsam Range Validator Example<br />

<br />




<td align="right">

Enter Age:</td>


<asp:TextBox ID="txtage" runat="server"></asp:TextBox>

<asp:RangeValidator ID="RangeValidator1" runat="server"

ControlToValidate="txtage" ErrorMessage="Enter age between 25 and 35"

MaximumValue="35" MinimumValue="25" ValidationGroup="vg1"></asp:RangeValidator>







<asp:Button ID="Button1" runat="server" Text="Submit" ValidationGroup="vg1" />








Output range validator example

Input the age between 25 and 35: range validator example


Pr.Pg border                                              Next Pg