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