473,473 Members | 1,825 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Application Start and Request events from a static constructor

I would like to attach an event handler to the application start
without having to use a Global.asax file. If this could be done from a
static constructor then that would be ideal. I guess
HttpContext.Current would be used. Also, I would like to attach an
event to the first request and then remove it. Does anyone have any
thoughts on how this can be done?

Thanks,
ThazKool

Oct 6 '06 #1
1 1394
Do you want to rewrite all of ASP.NET, or just this part? :-)

You cna check to see if a piece of code has been fired and run it that way,
but you are not going to get to a true static constructor scenario without
overwriting a lot of the framework. A Singleton added to every page or to
global.asax (which you do not want to use for some reason) will solve this.

Or, if it is something you can do on first request, a singleton is a great
option. Run the code on initial "instantiation" of the singleton.

Without understanding the What (what you are wanting to do) and Why (why you
think it has to be done this way), I cannot add much more.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************************************************
Think outside of the box!
*************************************************
"ThazKool" <Ch**********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
>I would like to attach an event handler to the application start
without having to use a Global.asax file. If this could be done from a
static constructor then that would be ideal. I guess
HttpContext.Current would be used. Also, I would like to attach an
event to the first request and then remove it. Does anyone have any
thoughts on how this can be done?

Thanks,
ThazKool

Oct 6 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Mark Fisher | last post by:
I have a Java desktop GUI application that the user can run multiple times. In order to keep one instance of the application distinct from another, I'd like to put the instance number of the...
12
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am...
9
by: Guy | last post by:
I have extended the datetimepicker control to incorporate a ReadOnly property. I have used the new keyword to implement my own version of the value property, so that if readonly == true then it...
4
by: Beenish Sahar Khan | last post by:
I want to start my application so that its notify icon is added to the system tray, i don't want to show any starting form. I want user to interact through the notify icon...just like MSN. Is there...
1
by: Mike Logan | last post by:
In the Init Method, I would like to add a delegate to the Application_Start. However the Application_Start is not an event of the HTTPApplication class. Is there some other way to access this...
16
by: Fernando Arámburu | last post by:
Hi , it´s me again. I will take another way because yesterday I make a question and, probably I didn´t make myself clear so you didn´t understand my question. I want to know if there is any...
16
by: anonymous.user0 | last post by:
The way I understand it, if I have an object Listener that has registered as a listener for some event Event that's produced by an object Emitter, as long as Emitter is still allocated Listener...
4
by: Dave | last post by:
I have a global.asax file with Application_Start defined and create some static data there and in another module used in the asp.net application and I realize that static data is shared amongst...
7
by: Cramer | last post by:
In addition to Web.config, I have a few configuration values that I store in a sql server database. I would like to read them from the database only once per Application.Start (there is no need to...
0
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,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
1
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...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
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 ...

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.