Ejemplo n.º 1
0
    protected void btnSignUp_Click(object sender, EventArgs e)
    {
        if (IsValid == false)
        {
            return;
        }

        User user = new User()
        {
            FirstName = txtFirstName.Text,
            LastName  = txtLastName.Text,
            Email     = txtEmail.Text.ToLower(),
            Phone     = txtPhone.Text,
            UserName  = txtUserName.Text
        };

        string password = txtPassword.Text;

        user.Password = MyWebAuthentication.HashPassword(password); // hash the pass with 16 SaltSize (default set)

        try
        {
            users.CreateNewUser(user);
        }
        catch { }

        MyWebAuthentication.UserID = users.GetUser(user.Email).UserID;

        Response.Redirect("Member?u=" + MyWebAuthentication.UserID); // need to create a page called "memeber"
    }