protected void btn_signup_Click(object sender, EventArgs e) { try { // Create new user. objuser.email=txt_email.Text; objuser.password=txt_password.Text; objuser.username = TextBox1.Text; if (Membership.RequiresQuestionAndAnswer) { MembershipUser newUser = Membership.CreateUser(objuser.email,objuser.password,objuser.username); } else { MembershipUser newUser = Membership.CreateUser( objuser.email, objuser.password, objuser.username); int i = BusinessUser.BusinessRegisterUser(objuser); if (i > 0) { Session["user_authenticate"] = "Verified"; Session["user_email"] = objuser.email; Label1.Text = Session["user_email"].ToString(); login1.Style.Add("display", "none"); logout.Visible = true; Response.Redirect("user_registration.aspx"); } } show_menu(); //Response.Redirect("login.aspx"); } catch (MembershipCreateUserException ex) { WarningModal.Show(); lblWarning.Text = GetErrorMessage(ex.StatusCode); pnlIssues.Visible = true; } catch (HttpException ex) { WarningModal.Show(); lblWarning.Text= ex.Message; } } protected void loginUser_Authenticate(object sender, AuthenticateEventArgs e) { try { if (Membership.ValidateUser(loginUser.UserName, loginUser.Password)) { Session["user_authenticate"] = "Verified"; e.Authenticated = true; Session["user_email"] = loginUser.UserName; objuser.email = Session["user_email"].ToString(); Label1.Text = Session["user_email"].ToString(); login1.Style.Add("display", "none"); logout.Visible = true; } else { e.Authenticated = false; } } catch (Exception ex) { } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)