会话变量问题 [英] Issue with Session variable

查看:80
本文介绍了会话变量问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我有一个会话变量,并为该变量分配了一个值

I have a session variable and I assign a value to this variable say

Session ["BillNo"] = 45;

Session["BillNo"] = 45;

我了解可以在多个页面上访问会话值.但是,在不同的页面上,在save_click事件上,我想将此会话变量传递给存储过程,但是当我尝试调试时,我看到此会话变量没有 保持价值.知道为什么吗?

I understand that Session values are accessible across multiple pages. However on a different page, on the save_click event, I want to pass this session variable to a stored procedure, but when I try debugging I see that this session variable does not hold the value anymore. Any idea why?

谢谢

弗农

 

推荐答案

你好弗农,

检查以确保在您的Web应用程序中启用了会话.您可以在IIS中或使用web.config文件来执行此操作.请看以下内容,以更好地了解会话变量.

Check to make sure that session is enabled in your web application. You can do this either in IIS or using the web.config file. Take a look at the following for a better understanding of session variables.

http://msdn.microsoft.com/en-us/library/ms972429.aspx

希望有帮助!


这篇关于会话变量问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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