Range V Lid at or Example
Range V Lid at or Example
Range Validator.aspx
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td>
<b>Age</b>
</td>
<td>:<asp:TextBox ID="txtAge" runat="server"
Width="150px"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator1" runat="server"
ErrorMessage="Please Enter an Age Between 1 t0 100!" ControlToValidate="txtAge"
MinimumValue="1" MaximumValue="100" Type="Integer" ForeColor="Red"
Display="Dynamic"></asp:RangeValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
runat="server" ErrorMessage="Age Field is required!" ControlToValidate="txtAge"
ForeColor="Red" Display="Dynamic"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<b>Date</b>
</td>
<td>:<asp:TextBox ID="txtDate" runat="server"
Width="150px"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator2" runat="server"
ErrorMessage="Please Enter a Valid Date of Year 2017!" ControlToValidate="txtDate"
MinimumValue="01/01/2017" MaximumValue="12/30/2017" Type="Date" ForeColor="Red"
Display="Dynamic"></asp:RangeValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2"
runat="server" ErrorMessage="Date Field is required!" ControlToValidate="txtDate"
ForeColor="Red" Display="Dynamic"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Button ID="btnsave" runat="server" Text="Save" Width="100px"
OnClick="btnsave_Click" />
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="lblStatus" runat="server" Font-
Bold="true"></asp:Label>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
RangValidator.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication1
{
public partial class RangeValidator : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}