473,729 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Under what context Application events run in Global.asax

Ram
(I am running .NET Framework 1.1)

I have a timer(System.Ti mers.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.Cur rent.Cache("xxx "). I am getting an error saying that
HttpContext.Cur rent is nothing.

I also tried to check HttpContext.Cur rent.User.Ident ity.Name and got
an error and it says HttpContext.Cur rent.User is nothing.

I tried to get HttpContext.Cur rent.User.Ident ity.Name in
Application_ons tart event and got the same error -
HttpContext.Cur rent.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 2476
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.Cur rent.User.Ident ity.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**********@y ahoo.com> wrote in message
news:fe******** *************** **@posting.goog le.com...
(I am running .NET Framework 1.1)

I have a timer(System.Ti mers.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.Cur rent.Cache("xxx "). I am getting an error saying that
HttpContext.Cur rent is nothing.

I also tried to check HttpContext.Cur rent.User.Ident ity.Name and got
an error and it says HttpContext.Cur rent.User is nothing.

I tried to get HttpContext.Cur rent.User.Ident ity.Name in
Application_ons tart event and got the same error -
HttpContext.Cur rent.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4667
by: Arjen | last post by:
Hi, I load my website settings inside the global.asax file. For this I have to use the context, to get the roles from the current browsing client. The problem is that there is no context at that time. (no reference) When I add these code lines (from global.asax) inside an aspx file, then it works. Because there is a context.
2
4791
by: Colin | last post by:
Hi altogether, I ran into a problem with asp.net: I tried to create a pure web application WITHOUT any asax or aspx pages. Only one .dll in the bin folder supplying a HttpApplication and some IHttpModules etc.. All pages are created dynamicly using a xml data source and converting through xslt. Now I have the problem, that asp.net does not start my HttpApplication
1
1729
by: Mike Hutton | last post by:
I need some help. I am trying to set up our development environment so as to make life easy for my fellow developers (none of whom have used ASP.NET or VS.NET before). We are developing our intranet which will comprise basic content with a number of small data-driven ASP.NET applications. I need to keep things simple, so I need to avoid stuff which needs too much in-depth knowledge to work.
6
2637
by: jim | last post by:
Hi All, I like to know the life cycle of an ASP .NET Application( incudieng server application, such as .NET Web Service). That means from initialization to fully running and how to reboot it or shut it down. Including how to establish the running environment( current working folder, ...etc) for each ASP .NET application. Because in my ASP .NET application, there are a lot of modules. Some were developed by using VC#, others using...
14
2398
by: Roland Hall | last post by:
Since I'm not getting any response from the community, I'm reposting this under my managed account. I've turned my web.config friendly error messages off and it may be easier to view what I'm experiencing than try to translate it. Here's the error: Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="netfraud.us.Global" %>
20
4492
by: J-T | last post by:
We are working on an asp.net application which is a 3-tier application.I was aksed to create a component which monitors a folder and gets the file and pass them to a class library in our business logic layer(so far so good and easy).I initialize my class which is using a FileSystemWatcher in my Global.asax and everything works fine.I have found FileSystemWatcher class not very reliable and sometimes it behavies unexpectedly.I'm afriad that...
8
4867
by: Vishwanathan Raman | last post by:
Hi I have a declared a static DataSet object SOBJ in Global.asax.I also have a localy defined DataSet LSOBJ in Global.asax which I am storing in Application State.Is there any technical differences in the way both the objects are handled by IIS. Are both objects stored in different memory spaces? I can access both the objects in my web page. I will be grateful if some one can help me understand the difference.
6
1498
by: Chase | last post by:
I'm pretty new to asp.net and am having problems with my application timing out. I've written an application that loops through all of the information on an excel spreadsheet and does certain things with it, like creating and configuring WSS sites. My application runs fine for approximately 25 minutes, then I get the 'Page cannot be displayed' error. It seems like my browser times out before the application can finish what its doing.
11
4964
by: Marc | last post by:
Hello. Apologies if this is the wrong group. I have created a class called "page" which i would like to add to the global.asax and then call from any control within the website. I have currently got: global.asax <%@ import Namespace="myNamespace" %> <script language="C#" runat="server">
0
8932
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8767
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9428
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9222
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6028
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4799
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3246
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2173
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.