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. Advertising

  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


    --
    Hope this helps,
    Mark Fitzpatrick
    Microsoft MVP - FrontPage


    "kai" <> wrote in message
    news:LrdCi.6391$...
    > 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
    >
     
    Mark Fitzpatrick, Sep 2, 2007
    #2
    1. Advertising

  3. kai

    kai Guest

    Thanks Mark.

    Kai

    "Mark Fitzpatrick" <> wrote in message
    news:...
    > 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
    >
    >
    > --
    > Hope this helps,
    > Mark Fitzpatrick
    > Microsoft MVP - FrontPage
    >
    >
    > "kai" <> wrote in message
    > news:LrdCi.6391$...
    >> 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 3, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Keith Patrick
    Replies:
    1
    Views:
    2,101
    Keith Patrick
    Dec 2, 2005
  2. David R.
    Replies:
    1
    Views:
    6,027
    Christopher Reed
    Jan 8, 2006
  3. pj
    Replies:
    2
    Views:
    1,942
  4. Deniz Bahar
    Replies:
    2
    Views:
    480
    Andrey Tarasevich
    Mar 9, 2005
  5. Shailesh Patel
    Replies:
    0
    Views:
    465
    Shailesh Patel
    Nov 8, 2006
Loading...

Share This Page