当页面重新加载asp.net会话丢失(的IsPostBack = FALSE) [英] asp.net sessions lost when the page is reloaded (ispostback = false)

查看:128
本文介绍了当页面重新加载asp.net会话丢失(的IsPostBack = FALSE)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很奇怪的问题做会话变量。

I have a really strange problem to do with session variables.

我有一个设置了几个会话变量一个asp.net页面。在我的机器(本地主机),我做了回发,但仍填充会话值。

I have an asp.net page that sets a few session variables. On my development machine (localhost), I do a postback and the session values are still populated.

当我通过点击地址栏和pressing进入重新加载页面的会话变量仍然存在。

When I Reload the page by clicking on the url bar and pressing enter the session variables are still there.

然而,当我部署本页面给Web服务器,页面还是做回发时保留了会话值,但只要我点击的URL和preSS输入会话值会丢失(其中的IsPostBack = FALSE )

However when i deploy this page to a webserver, the page still retains the session values when doing a postback, but as soon as i click the url and press enter the session values are lost (where the ispostback = false)

但当我preSS的刷新按钮会话变量present(但我确实看到一个弹出警告我的页面数据需要重新发送!)

But when i press the refresh button the session variables are present (but i do get a popup warning me that the page data needs to be resent!)

我运行IE 7,web服务器是IIS6我究竟做错了什么?

i am running IE 7, and the webserver is iis6 what am i doing wrong?!

请帮助X

推荐答案

什么会话状态提供您使用?默认值为是InProc 后,即会被保存在asp.net工作进程。这意味着,如果应用程序池被回收会话状态可能会丢失或网络服务器内存不足。你可以尝试使用的StateServer 模式,即会话存储在服务器上运行一个单独的服务。您可以更改的web.config 如模式。

What session state provider are you using? The default is InProc, whereby sessions are stored in the asp.net worker process. This means session state can be lost if the application pool is recycled or the webserver is low on memory. You could try using StateServer mode, whereby sessions are stored in a separate service running on the server. You can change the mode in web.config eg.

<system.web>
    <sessionState mode="StateServer" />
</system.web>

请参阅 http://support.microsoft.com/kb/307598

这篇关于当页面重新加载asp.net会话丢失(的IsPostBack = FALSE)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆