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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top