0

hey buddies:)
here is login page for begining purpose in asp.net
i hope you will enjoy it
and it is expected there is some mistakes also
so please feedback it.
Thanks

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

<!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>
</head>
<body>
    <form id="form1" runat="server">
    <div>
  <P>      E-mail Address:<br />
        <asp:TextBox ID="emailtextbox" runat="server" Height="16px" Width="331px"></asp:TextBox>
   <asp:RequiredFieldValidator ID="emailreq" runat="server"
   controltovalidate="emailtextbox"
   errormessage="Email Address Is Required!"
   setfocusonerror="true" display=Dynamic />
   <asp:RegularExpressionValidator ID="emailvalidator" 
   runat="server" controltovalidate="emailtextbox"
   validationexpression="^\S+@\S+\.\S+$"
   errormessage="you must enter valid email" />
  
   </P>
    <!-- Username -->
<p>
Username:<br />
<asp:TextBox id="usernameTextBox" runat="server" />
<asp:RequiredFieldValidator id="usernameReq"
runat="server"
ControlToValidate="usernameTextBox"
ErrorMessage="Username is required!" />
</p>
<!-- Password -->
<p>
Password:<br />
<asp:TextBox id="passwordTextBox" runat="server"
TextMode="Password" Height="16px" Width="251px" />
<asp:RequiredFieldValidator id="passwordReq"
runat="server"
ControlToValidate="passwordTextBox"
ErrorMessage="Password is required!" />
</p>
<!-- Submit Button -->
<p>Address:<br />
<asp:TextBox ID="addresstextbox" runat="server"
 TextMode="SingleLine" Height="21px" Width="314px"/>
<asp:RequiredFieldValidator ID="addressreq"
runat="server"
controltovalidate="addresstextbox" errormessage="Please Enter your Address" />

</p>
        <p>
            <asp:TextBox ID="TextBox1" runat="server" Height="22px" 
                ontextchanged="TextBox1_TextChanged" Width="314px"></asp:TextBox>
            </p>
        <p>Birthdate: <br />
            <asp:TextBox ID="birthdatetextbox" runat="server" />
            <asp:RangeValidator ID="birthdaterangetest" runat="server"
            type="Date" ControlToValidate="birthdatetextbox" 
            MinimumValue="1/1/1970" MaximumValue="12/31/1999"
            ErrorMessage="You must enter value in b/w 1900 to 1999 to acess this feature" />
           <asp:RequiredFieldValidator ID="bithdatereq"
           runat="server" 
           controltovalidate="birthdatetextbox" ErrorMessage="It must to enter your birthdate" />
     
             </p>
<p>
<asp:Button id="submitButton" runat="server"
Text="Submit" onclick="submitButton_Click" />
</p>


    </div>
    </form>
</body>
</html>
4
Contributors
5
Replies
7
Views
8 Years
Discussion Span
Last Post by umamahesh2020
1

1: not sure if you want that regularExpression for email. If you select RgexValidator in Designmode and look at ValidationExpression propertie you can select Internet Email address

i.e. \w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*

2: You BirthDate validator had Value 1970-1999 but your error message says 1900-1999.

0

oh really sorry for this and thanks for indicating my fault and i have said that mistakes are probable.

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.