会话问题-ASP.NET(C#) [英] Session Problem - ASP.NET (C#)

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

问题描述



在我的应用程序中,我使用会话存储了用户名,然后在主页上获取值,每当我第一次登录该应用程序时,该消息就会显示,该会话中为空值.谁能帮我解决这个问题.


谢谢,
Sureshkumar.G

Hi,

In my application I have stored the username using session and then get the value in main page, whenever i login the application 1st time the message shows, null value in the session. can any one please help me solve this problems.


Thanks,
Sureshkumar.G

推荐答案

可能有两种可能性.

1.可能是您将用户名存储在会话中的任何其他页面中,而不是登录页面中.

2.可能是您的会话过期了.

谢谢

Mehul Thakkar
There could be 2 possibilities.

1. May be you have store your username in session from any other page rather than login page.

2. May be your session get expired.

Thanks

Mehul Thakkar


如果是第一次,那必须表示您在页面呈现后进行了设置,或者代码在设置之前在页面周期内进行了检查.
If it''s only the first time, it must mean that you set it after the page has rendered OR that your code checks it within your page cycle prior to it being set.


这篇关于会话问题-ASP.NET(C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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