Пример #1
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        string username = Request.Form["UserID"];
        string password = Request.Form["Password"];

        if (username != null)
        {

            MembershipController mbsController = new MembershipController();
            if (mbsController.ValidateUser(username, password))
            {
                FormsAuthentication.RedirectFromLoginPage(username, false);
            }
            else
            {
                //if (mbsController.isSuspended(username))
                //{
                //    Response.Redirect(HostPortal + "LoginPage.aspx?ReturnUrl=%2fCINAPQRI%2f&Error=" + "Your Account is locked");
                //}

                //if (Convert.ToBoolean(HttpContext.Current.Session["isExpired"]))
                //{
                //    Session.Remove("isExpired");
                //    Response.Redirect(HostPortal + "LoginEsp.aspx?PassExpired=true&Code=" + HttpContext.Current.Session["CodeGUID"].ToString());

                //}

                //Response.Redirect(HostPortal + "LoginPage.aspx?ReturnUrl=%2fCINAPQRI%2f&Error=" + "Invalid Login");
            }
        }
    }
Пример #2
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        string username = Request.Form["UserID"];
        string password = Request.Form["Password"];

        if (username != null)
        {
            MembershipController mbsController = new MembershipController();
            if (mbsController.ValidateUser(username, password))
            {
                FormsAuthentication.RedirectFromLoginPage(username, false);
            }
            else
            {

            }
        }
    }