friedkiwi
friedkiwi

Reputation: 2198

Access "Application" object in ASP.Net MVC to store application wide variables

How do I store a variable or object application wide in ASP.net MVC?

In regular ASP, you had the Application object and in ASP.net too apparently.

I'm using ASP.net MVC 2.

Upvotes: 13

Views: 10397

Answers (1)

jwsample
jwsample

Reputation: 2411

In a controller you should be able to do this:

this.HttpContext.Application["foo"] = "bar";

Upvotes: 23

Related Questions