SqlParameter[] paramater = new SqlParameter[] { new SqlParameter("@User_Name",Login1.UserName), new SqlParameter("@Password",Login1.Password) }; SqlDataReader dr = (SqlDataReader)db.ExecuteReader("Login", paramater); if (dr.HasRows) { FormsAuthentication.RedirectFromLoginPage(Login1.UserName, false); Response.Redirect(@"~/Home.aspx", false); }
<authentication mode="Forms"> <forms loginUrl="~/LogIn.aspx" protection="All" slidingExpiration="true" timeout="2880"</authentication>
protected void Page_Load(object sender, EventArgs e) { if (!HttpContext.Current.User.Identity.IsAuthenticated) { Response.Redirect("~/LogIn.aspx"); } } protected void HeadLoginStatus_LoggedOut(object sender, EventArgs e) { FormsAuthentication.SignOut(); Response.Redirect(@"~/Login.aspx", false); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)