会话值在回发期间不会持久存在 [英] Session value not persisting during postback

查看:84
本文介绍了会话值在回发期间不会持久存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用会话变量将值从我网站的第一页传递到下一页。这完全适用于我的localhost。但是,当我在远程Web服务器中部署该代码时,它无法正常工作。回发后变量不会停留。

I am trying to pass values from first page of my website to the next page using session variables. This is working in my localhost perfectly. However, when I deploy that code in a remote web server, it not working. The variables are not staying after postback.

任何解决方法(如使用视图状态,查询字符串)都不可行,因为有很多页面,重新编码需要花费很多时间。请建议任何解决方案,使这件事工作。我正在使用ASP.NET framework 4.0,IIS 6

Any workaround (like using view states, querystring) would not be feasible, as there are numerous pages, and recoding would take a lot of time. Please suggest any solution to make this thing work. I am using ASP.NET framework 4.0, IIS 6

推荐答案

唯一可能的答案这就是在IIS上配置会话的方式。 

The only possible answer to this is how Sessions are configured on IIS. 

在IIS 6中,"应用程序配置"下有一个选项可启用会话状态。

In IIS 6, there is an option under Application Configuration to enable Session State.

我还会检查会话超时值。 如果设置得非常低,可能会让人感觉价值没有被保存。

I would also check the Session Timeout value.  If set really low, it could give the perception of values not being saved.


这篇关于会话值在回发期间不会持久存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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