locked
redirecting a newly created user RRS feed

  • Question

  • User1600211223 posted

    I am using the security controls to create a new user. Once the user has been created I want them to be redirected to their user page keeping them logged in. 

    This is what I attempted:

     Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser
    
    
            Response.Redirect("~/Account/Profile/details.aspx")
    
        End Sub

    The redirect works fine, but the user is not logged in (the login name and login status are not set). How after creating a new user do I automatically log them in then redirect them?

    Saturday, May 19, 2012 8:00 AM

Answers

  • User1648350404 posted

    in CreateUserWizard1_CreatedUser event Try following code as first line.

    FormsAuthentication.SetAuthCookie(CreateUserWizard1.UserName,true);

    Check following:

    http://forums.asp.net/t/1685386.aspx/1

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, May 19, 2012 8:10 AM

All replies

  • User1648350404 posted

    in CreateUserWizard1_CreatedUser event Try following code as first line.

    FormsAuthentication.SetAuthCookie(CreateUserWizard1.UserName,true);

    Check following:

    http://forums.asp.net/t/1685386.aspx/1

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, May 19, 2012 8:10 AM
  • User-793801990 posted

    Ya i think creating a cookie is the option to take the user to home page or second page after registering in the first step.

    Monday, May 21, 2012 1:28 PM