会话无法正常工作.. [英] Session Not Working..
本文介绍了会话无法正常工作..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
会话值在重定向到其他页面后变为空
我该如何解决这个问题?
Session value becomes null after redirecting to different page
How can i solve this problem ???
推荐答案
这不会发生.您可能正在页面加载事件中清除会话值.
另外,在读取会话值时,请不要忘记投射对象.
例如:
如果您愿意,则在进行会话时
Session ["Region"] ="Asia";
阅读时将其强制转换为ToString();
字符串Val = Session ["Region"].ToString();
This will not happen. You might be clearing the session value in page load event.
Also while reading the session value dont forget to cast the object.
For Ex:
while assinging session if u give
Session["Region"]= "Asia";
While reading cast it to ToString();
string Val = Session["Region"].ToString();
这篇关于会话无法正常工作..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文