S
Shiv Kumar
I see that the Application_OnStart event is fired only once for a certain application.
I'm interested in creating a "global" object (an object that will be available to all requests for the application). I thought I could use this event to create an instance of my object.
I find that the event does get fired and an instance is created. However, when I reference this object from a page it is null. What gives?
What is the recommended way to declare, create etc. my class such that an single instance is created (application wide) and that all my pages have access to this object.
I don't mind if I have to make this object thread-safe and a singleton either. I'd just like to know the recommended way and if this is at all possible.
I'm interested in creating a "global" object (an object that will be available to all requests for the application). I thought I could use this event to create an instance of my object.
I find that the event does get fired and an instance is created. However, when I reference this object from a page it is null. What gives?
What is the recommended way to declare, create etc. my class such that an single instance is created (application wide) and that all my pages have access to this object.
I don't mind if I have to make this object thread-safe and a singleton either. I'd just like to know the recommended way and if this is at all possible.