Login Status Check Page
----------------------------------------------------------------------------------------------------------------------------------------------
if (!HttpContext.Current.User.Identity.IsAuthenticated)
Response.Redirect(SiteSettings.BaseUrl + "admin/login.aspx?ReturnUrl="+Page.AppRelativeVirtualPath.ToString());
=========================================================================
login.asp.cs Page
----------------------------------------------------------------------------------------------------------------------------------------------
Admin_User admin = new Admin_UserBLL().GetAdminUserByUserNamePassword(txtUserName.Text.Trim(), txtPassword.Text.Trim());
if (admin != null)
{
System.Web.Security.FormsAuthentication.RedirectFromLoginPage(admin.User_Name, true);
string ReturnUrl = Request.QueryString["ReturnUrl"];
if (!string.IsNullOrEmpty(ReturnUrl))
{
Response.Redirect(ReturnUrl);
}
else
{
Response.Redirect(SiteSettings.BaseUrl + "admin/Default.aspx");
}
}
else
{
divMessage.Visible = true;
divMessage.Attributes.Add("class", "error");
divMessage.InnerHtml = "Please provide user name and password correctly and try again.";
}
No comments:
Post a Comment