469,587 Members | 2,134 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,587 developers. It's quick & easy.

Under what context Application events run in Global.asax

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
Nov 18 '05 #1
1 2205
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


--
Thanks and Regards,

Amit Agarwal
Software Programmer(.NET)
"Ram" <ra**********@yahoo.com> wrote in message
news:fe*************************@posting.google.co m...
(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

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.583 / Virus Database: 369 - Release Date: 2/10/2004
Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Arjen | last post: by
2 posts views Thread by Colin | last post: by
6 posts views Thread by jim | last post: by
14 posts views Thread by Roland Hall | last post: by
8 posts views Thread by Vishwanathan Raman | last post: by
6 posts views Thread by Chase | last post: by
11 posts views Thread by Marc | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.