asp.net login some part coding

nirveshverma 0 Tallied Votes 153 Views Share

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>
guru_sarkar 0 Junior Poster in Training

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.

nirveshverma -1 Light Poster

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

nirveshverma -1 Light Poster

keep reply and feedback

Bukhari1986 -4 Newbie Poster

not working with my website :(
my website supports .net2.0 only

umamahesh2020 -5 Light Poster

while you are putting this into a Table It looks Perfect.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.