コード例 #1
0
ファイル: Login.aspx.cs プロジェクト: go4zee/Quiz-App-CSharp
        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);
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 protected void AddNewUserButton_Click(object sender, EventArgs e)
 {
     AuthUser au = AuthUser.GetAuthUser(Session);
 }