开发者

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

开发者 https://www.devze.com 2023-01-10 10:38 出处:网络
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.

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.


In a controller you should be able to do this:

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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号