Professional Web Applications Themes

How to pass username in the login control to next page? - ASP.NET Security

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

  1. #1

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

    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 Guest

  2. #2

    Default Re: How to pass username in the login control to next page?

    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" <net> wrote in message
    news:LrdCi.6391$bellsouth.net... 


    Mark Guest

  3. #3

    Default Re: How to pass username in the login control to next page?

    Thanks Mark.

    Kai

    "Mark Fitzpatrick" <com> wrote in message
    news:phx.gbl... 
    >
    >[/ref]


    kai Guest

Similar Threads

  1. X509 and UserName/Pass in SOAP header?
    By cootmonster in forum ASP.NET Web Services
    Replies: 2
    Last Post: March 28th, 01:46 AM
  2. Replies: 1
    Last Post: April 7th, 02:51 PM
  3. cfpop errors when username/pass contain numbers
    By ihsutd in forum Coldfusion - Advanced Techniques
    Replies: 2
    Last Post: September 17th, 12:35 PM
  4. How to pass variables from aspx page to user control
    By Sathyadeva Aithal via .NET 247 in forum ASP.NET Building Controls
    Replies: 1
    Last Post: June 5th, 08:23 PM
  5. how to pass along username/password with UA request?
    By dan baker in forum PERL Modules
    Replies: 3
    Last Post: July 17th, 09:54 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139