示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         try
         {
             if (!AutenticacaoBll.UsuarioAutenticado(this.Page))
             {
                 FormsAuthentication.SignOut();
                 FormsAuthentication.RedirectToLoginPage();
                 //Response.Redirect("~/Acesso/Login.aspx");
             }
         }
         catch (Exception ex)
         {
             Msg.Erro(ex.Message, this);
         }
     }
 }
示例#2
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string login = txtLogin.Text;
            string senha = txtSenha.Text;

            try
            {
                bool permissao = AutenticacaoBll.Login(login, senha);

                if (permissao)
                {
                    FormsAuthentication.RedirectFromLoginPage(login, false);
                }
                else
                {
                }
            }
            catch (Exception ex)
            {
            }
        }