T
Tarun Mistry
Hi all,
I'm trying to create a global object that can be used anywhere in my ASP.NET
(2.0) application but im having problems.
I would like to run some logic every time the page is loaded, this logic
then initalises a global variable (an object) of type "ShoppingCart".
ShoppingCart needs access to the system Session and the Response objects.
Originally, I put my code into the global.asax file under the
"session_start" member, exposing the ShoppingCart object as a static
variable. I have realised here my code only runs once, when the session is
started, and not EVERY time the page is loaded.
I am not sure where to create my ShoppingCart object such that it will be
available to the rest of the system. I Tried Application_Start however at
this point the Session and Response objects have not yet been initialised.
Any advice welcome! Thanks for your help.
Taz
I'm trying to create a global object that can be used anywhere in my ASP.NET
(2.0) application but im having problems.
I would like to run some logic every time the page is loaded, this logic
then initalises a global variable (an object) of type "ShoppingCart".
ShoppingCart needs access to the system Session and the Response objects.
Originally, I put my code into the global.asax file under the
"session_start" member, exposing the ShoppingCart object as a static
variable. I have realised here my code only runs once, when the session is
started, and not EVERY time the page is loaded.
I am not sure where to create my ShoppingCart object such that it will be
available to the rest of the system. I Tried Application_Start however at
this point the Session and Response objects have not yet been initialised.
Any advice welcome! Thanks for your help.
Taz