How can I use session state information in a serveruser control

T

ton

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
 
B

Bob Brunton

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
 
T

ton

it is easy and it work fine
perfect

thanx
ton
Bob Brunton said:
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" <[email protected]> wrote in message
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top