开发者

Application object access from regular class in ASP.Net

开发者 https://www.devze.com 2023-02-20 05:45 出处:网络
Our teachers (coaches for this project) suggested to store our DAO objects in the Application object, so there\'s one object of开发者_开发技巧 each available for the whole application.

Our teachers (coaches for this project) suggested to store our DAO objects in the Application object, so there's one object of开发者_开发技巧 each available for the whole application.

This Application object is easily accessed in the Page codebehind itself, but how do we access it from a plain class that is not extending anything?


For code in classes, you can use HttpContext.Current.Application, for which you need to import the System.Web namespace.

0

精彩评论

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