How can I use session state information in a serveruser control

Discussion in 'ASP .Net Building Controls' started by ton, Feb 3, 2004.

  1. ton

    ton Guest

    Hi,
    once a user has logged in I want to use some variable in the other custom
    server controls I've developed. In the page, where the controls are added I
    can use something like:
    session("Logname")="Roger"
    but how can I use this variable in de custom server control.

    Or how can I add a session variable in the custom server control and show
    this variable in the page.

    Ton
     
    ton, Feb 3, 2004
    #1
    1. Advertising

  2. ton

    Bob Brunton Guest

    From within your COntrol you can access session through the
    HttpContext


    System.Web.SessionState.HttpSessionState session =
    System.Web.HttpContext.Current.Session;


    From the HttpCOntext you have access to a lot of things.


    Nick Harrow



    "ton" <> wrote in message news:<bvoakt$p7b$1.nb.home.nl>...
    > Hi,
    > once a user has logged in I want to use some variable in the other custom
    > server controls I've developed. In the page, where the controls are added I
    > can use something like:
    > session("Logname")="Roger"
    > but how can I use this variable in de custom server control.
    >
    > Or how can I add a session variable in the custom server control and show
    > this variable in the page.
    >
    > Ton
     
    Bob Brunton, Feb 6, 2004
    #2
    1. Advertising

  3. ton

    ton Guest

    it is easy and it work fine
    perfect

    thanx
    ton
    "Bob Brunton" <> schreef in bericht
    news:...
    > From within your COntrol you can access session through the
    > HttpContext
    >
    >
    > System.Web.SessionState.HttpSessionState session =
    > System.Web.HttpContext.Current.Session;
    >
    >
    > From the HttpCOntext you have access to a lot of things.
    >
    >
    > Nick Harrow
    >
    >
    >
    > "ton" <> wrote in message

    news:<bvoakt$p7b$1.nb.home.nl>...
    > > Hi,
    > > once a user has logged in I want to use some variable in the other

    custom
    > > server controls I've developed. In the page, where the controls are

    added I
    > > can use something like:
    > > session("Logname")="Roger"
    > > but how can I use this variable in de custom server control.
    > >
    > > Or how can I add a session variable in the custom server control and

    show
    > > this variable in the page.
    > >
    > > Ton
     
    ton, Feb 6, 2004
    #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. shamanthakamani
    Replies:
    1
    Views:
    3,523
    Natty Gur
    Nov 20, 2003
  2. Not Liking Dot Net Today
    Replies:
    0
    Views:
    642
    Not Liking Dot Net Today
    Apr 21, 2004
  3. Maciek
    Replies:
    0
    Views:
    8,274
    Maciek
    Sep 15, 2005
  4. jnickfl1
    Replies:
    0
    Views:
    610
    jnickfl1
    Sep 18, 2006
  5. =?Utf-8?B?VG9u?=
    Replies:
    2
    Views:
    558
    =?Utf-8?B?VG9u?=
    Jun 22, 2007
Loading...

Share This Page