Ejemplo n.º 1
0
        protected void LoginButton_Click(object sender, EventArgs e)
        {
            var user = UsersMapper.GetUserByCredentials(Username.Text, Password.Text);

            if (user != null)
            {
                FormsAuthentication.SetAuthCookie(user.UserName, false);

                FrameworkSettings.CurrentUser = user;

                var returnUrl = (Request["ReturnUrl"] != null) ? Request["ReturnUrl"] : "~/admin/";

                Response.Redirect(returnUrl);
            }
            else
            {
                ErrorPanel.Visible = true;
            }
        }