Ejemplo n.º 1
0
 protected void RegisterUser_CreatedUser(object sender, EventArgs e)
 {
     var userObj = new User();
     userObj.UserName = UserName.Text;
     userObj.Password = Password.Text;
     userObj.EmailAddress = Email.Text;
     var obj = new UserBLL();
     var status = obj.Registeruser(userObj);
     if (status)
     {
         lblStatus.Text = "User Was Registered successfully.";
     }
     else
     {
         lblStatus.Text = "Registration was not successfull. Please try again later.";
     }
 }
Ejemplo n.º 2
0
        private void AuthenticateUser()
        {
            User userObj = new UserBLL().ValidateUser(UserName.Text, Password.Text);

            if (userObj != null)
            {
                if (Request.QueryString["ReturnUrl"] != null)
                {
                    FormsAuthentication.RedirectFromLoginPage(UserName.Text, false);
                }
                else
                {
                    Common.SetSession(userObj);
                    FormsAuthentication.SetAuthCookie(UserName.Text, true);
                    Response.Redirect("~/Pages/Home.aspx");
                }
            }
        }