protected override void OnPreRender(EventArgs e) { AuthUser au = AuthUser.GetAuthUser(Session); if (au != null) { Response.Redirect("~/Dashboard.aspx"); } else { ClientScript.GetPostBackEventReference(this, string.Empty); txtPassword.Attributes.Add("onKeyPress", "javascript:if (event.keyCode == 13) __doPostBack('" + btnLogin.UniqueID + "','')"); base.OnPreRender(e); } }
protected bool validateAddUserForm() { bool retVal = false; if (userNameTextBox.Value.ToString() != "" && passwordTextBox.Value.ToString() == confirmpasswordTextBox.Value.ToString() && passwordTextBox.Value.ToString() != "" && userFirstNameTextBox.Value.ToString() != "" && userLastNameTextBox.Value.ToString() != "") { AuthUser au = AuthUser.GetAuthUser(Session); User u = UserHandler.CreateNew(au); u.UserName = userNameTextBox.Value.ToString(); u.Password = passwordTextBox.Value.ToString(); u.UserFirstName = userFirstNameTextBox.Value.ToString(); u.UserLastName = userLastNameTextBox.Value.ToString(); } else { } return(retVal); }
protected void AddNewUserButton_Click(object sender, EventArgs e) { AuthUser au = AuthUser.GetAuthUser(Session); }