How to pass username in the login control to next page?

Discussion in 'ASP .Net Security' started by kai, Sep 1, 2007.

  1. kai

    kai Guest

    Hi, All
    I have VB 2005, I use login control to logn in, after log in, I go to
    another page. I want to use the login username in another, how to use
    session varible to pass the username?

    I use the following code, but I cannot login:


    Protected Sub Login1_Authenticate1(ByVal sender As Object, ByVal e As
    System.Web.UI.WebControls.AuthenticateEventArgs)

    Session("username") = Login1.UserName

    End Sub


    Please help
    Thanks
    Kai
     
    kai, Sep 1, 2007
    #1
    1. Advertisements

  2. After a user is logged in they should be authenticated. This means you would
    access their username through their authentication typically. Try using
    Page.User.Identity.Name
     
    Mark Fitzpatrick, Sep 2, 2007
    #2
    1. Advertisements

  3. kai

    kai Guest

    Thanks Mark.

    Kai

     
    kai, Sep 3, 2007
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.