HttpApplicationState question..

  • Thread starter Thread starter Rajesh.V
  • Start date Start date
R

Rajesh.V

I saw this code

protected void Application_Start(Object sender, EventArgs e)
{

// Initialize the Environment

new SomeObject.

}



Does this mean to be the same as

Application.Add("Environment", someobject);
 
No, the "new SomeObject" in the Application_Start event, will only exist
within the scope of that event. The Application.Add(...) statement adds a
new application variable named "Environment" with a value of "someObject"
that *does* exist for the lifetime of the application.
 
Back
Top