Title: Login Page                                 If you need copy same format use firefox or chrome or safari but iexplorer not work


Preview of Code
<form id="Form1" runat="server">
<fieldset>
<legend>Login</legend> 
<div class=`container`>
<asp:Label ID="Name" runat="server" Text="UserName:" CssClass="lbl"/>
<br/>
<asp:TextBox ID="txtUserName" runat="server" Height="22px"/>
<asp:RequiredFieldValidator ID="RV1" runat="server" 
                            ControlToValidate="txtUserName" 
                            ErrorMessage="Please Enter User Name" 
                            SetFocusOnError="True">*
</asp:RequiredFieldValidator><br />
</div>
 
<div class=`container`>
<asp:Label ID="lblPwd" runat="server" Text="Password:" CssClass="lbl"/>
<br/>
<asp:TextBox ID="txtPwd" runat="server" TextMode="Password" 
                         CssClass="pwd" Height="22px"/>
<asp:RequiredFieldValidator ID="RV2" runat="server" 
                            ControlToValidate="txtPwd" 
                            ErrorMessage="Your Password" 
                            SetFocusOnError="True">*
</asp:RequiredFieldValidator><br />
</div>
 
<div class=`container`>
<asp:Button ID="btnLogIn" runat="server" Text="Sign In" 
                          onclick="btnLogIn_Click"/>
</div>
                       
<div class=`container`>
<asp:HyperLink ID="HyperLink1" runat="server" 
NavigateUrl="~/ForgotPassword.aspx">Forgot Password ?</asp:HyperLink>
<br/>
</div>
<div class=`short_explanation`>New User ? 
<asp:HyperLink ID="HyperLink2" runat="server" 
NavigateUrl="~/Default.aspx">SignUp !</asp:HyperLink></div>                       
<asp:ValidationSummary ID="ValidationSummary1" 
                       runat="server" CssClass="error"/>
<br /><br />
<asp:Label ID="lblMsg" runat="server" Text="" CssClass="lbl"/>
</fieldset>
</form>
 
protected void btnLogIn_Click(object sender, EventArgs e)
    {
        //Create Connection String And SQL Statement
        string strCon = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
        string strSelect = "SELECT COUNT(*) FROM Users WHERE UserName = @Username AND Password = @Password";
 
        SqlConnection con = new SqlConnection(strCon);
        SqlCommand cmd = new SqlCommand();
        cmd.Connection = con;
        cmd.CommandType = CommandType.Text;
        cmd.CommandText = strSelect;
 
        SqlParameter username = new SqlParameter("@Username", SqlDbType.VarChar, 50);
        username.Value = txtUserName.Text.Trim().ToString();
        cmd.Parameters.Add(username);
 
        SqlParameter password = new SqlParameter("@Password", SqlDbType.VarChar, 50);
        password.Value = txtPwd.Text.Trim().ToString();
        cmd.Parameters.Add(password);
 
        con.Open();
        int result = (Int32)cmd.ExecuteScalar();
        con.Close();
 
        if (result >= 1)
        {
            Response.Redirect("UpdateProfile.aspx");
        }
        else
            lblMsg.Text = "Incorrect Username or Password";
        
    }