开发者

Application variables get lost after post-back

开发者 https://www.devze.com 2023-03-13 06:41 出处:网络
My ASP.Net application has a Server Control developed by us which needs to store some keys in the Application level (i.e. across users and sessions) for future use. However, I found thatthe count开发者

My ASP.Net application has a Server Control developed by us which needs to store some keys in the Application level (i.e. across users and sessions) for future use. However, I found that the count开发者_JAVA技巧 neither of Page.Application and HttpContext.Current.Application become zero after post-back or page-refresh.

Actually I've been facing such problem in case of Session, but I finally solve the Session persistence problem by changing the SessionState configuration the web.config:

<sessionState cookieless="UseCookies" mode="StateServer" ></sessionState>

However, I don't know if there exists any similar settings for Application State.

Please kindly advise.

Man Thanks!!!

William

-- UPDATE--

I'm using Visual Studio 2008, and the application is being tested on the Visual Studio ASP.Net Testing Server.


Application state should be alive until you reset (iisreset) your web server (application pool) Which kind or web server you are using? Are you testing this on visual studio? did you try to host it to IIS and try? Because Cassini (visual studio development server) has some issues regarding the sessions with me You might try IIS Express - http://learn.iis.net/page.aspx/868/iis-express-overview/ - http://weblogs.asp.net/scottgu/archive/2010/06/28/introducing-iis-express.aspx

0

精彩评论

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