<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="validationtest.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style1
{
width: 100%;
}
.style2
{
width: 145px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<table class="style1">
<tr>
<td class="style2">
NAME</td>
<td>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="NAME" runat="server"
ControlToValidate="TextBox1" ErrorMessage="*"></asp:RequiredFieldValidator>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
EMAIL ID
</td>
<td>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="TextBox2" ErrorMessage="ENTER YOUR ID"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="TextBox2" ErrorMessage="ID IN FORMATE"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
PASSWORD</td>
<td>
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator1" runat="server"
ControlToValidate="TextBox3" ErrorMessage="YOUR PASSWORD IS NOT STRONG"
MaximumValue="9999" MinimumValue="10"></asp:RangeValidator>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
RE PASSWORD</td>
<td>
<asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
<asp:CompareValidator ID="CompareValidator1" runat="server"
ControlToCompare="TextBox3" ControlToValidate="TextBox4"
ErrorMessage="PASSWORD IS NOT EQUAL"></asp:CompareValidator>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
AGE</td>
<td>
<asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator2" runat="server"
ControlToValidate="TextBox5" ErrorMessage="AGE IS NOT IN RANGE"
MaximumValue="30" MinimumValue="18"></asp:RangeValidator>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
MARKS</td>
<td>
<asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td>
<asp:Button ID="Button1" runat="server" Text="Button" />
</td>
<td>
</td>
</tr>
</table>
<div>
</div>
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
DisplayMode="List" ShowMessageBox="True" />
</form>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style1
{
width: 100%;
}
.style2
{
width: 145px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<table class="style1">
<tr>
<td class="style2">
NAME</td>
<td>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="NAME" runat="server"
ControlToValidate="TextBox1" ErrorMessage="*"></asp:RequiredFieldValidator>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
EMAIL ID
</td>
<td>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="TextBox2" ErrorMessage="ENTER YOUR ID"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="TextBox2" ErrorMessage="ID IN FORMATE"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
PASSWORD</td>
<td>
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator1" runat="server"
ControlToValidate="TextBox3" ErrorMessage="YOUR PASSWORD IS NOT STRONG"
MaximumValue="9999" MinimumValue="10"></asp:RangeValidator>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
RE PASSWORD</td>
<td>
<asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
<asp:CompareValidator ID="CompareValidator1" runat="server"
ControlToCompare="TextBox3" ControlToValidate="TextBox4"
ErrorMessage="PASSWORD IS NOT EQUAL"></asp:CompareValidator>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
AGE</td>
<td>
<asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator2" runat="server"
ControlToValidate="TextBox5" ErrorMessage="AGE IS NOT IN RANGE"
MaximumValue="30" MinimumValue="18"></asp:RangeValidator>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
MARKS</td>
<td>
<asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td>
<asp:Button ID="Button1" runat="server" Text="Button" />
</td>
<td>
</td>
</tr>
</table>
<div>
</div>
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
DisplayMode="List" ShowMessageBox="True" />
</form>
</body>
</html>
No comments:
Post a Comment