Under what context Application events run in Global.asax

R

Ram

(I am running .NET Framework 1.1)

I have a timer(System.Timers.Timer) running in my Global.asax page. In
the timer.elapsed event I am trying to access an object I stored in
the Cache.
HttpContext.Current.Cache("xxx"). I am getting an error saying that
HttpContext.Current is nothing.

I also tried to check HttpContext.Current.User.Identity.Name and got
an error and it says HttpContext.Current.User is nothing.

I tried to get HttpContext.Current.User.Identity.Name in
Application_onstart event and got the same error -
HttpContext.Current.User is nothing.

Can someone please tell me where I am going wrong.

It is very critical for my project to access the cache object in the
timer.elapsed event.

Thanks
Ram
 
N

.NET Follower

hi,
if u want to capture Session and cache objects in the application events in
global file
i think(please verify it) they are not accesssible ...

atleast Session we cannot access thats for sure.....

and secondly
HttpContext.Current.User.Identity.Name
wrks if use forms authentication and what u set in there
say user id if u set there in the forms auth code.
u can access anywhere uw ant ..

that involves using namespace system.Secuity..etc
 

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

Forum statistics

Threads
474,263
Messages
2,571,064
Members
48,769
Latest member
Clifft

Latest Threads

Top