日期:2014-05-18  浏览次数:20442 次

使用session时出现Object reference not set to an instance of an object.怎么解决?
使用session时出现Object reference not set to an instance of an object.怎么解决?[b][/b]

[color=#FF0000][/color]我使用session传递用户名的值,但是我想未登陆状态也可以浏览页面,结果出现上述问题!
 

小弟刚入门,不懂得还请各位大虾多多提携啊!

------解决方案--------------------
if (session["xxx"] != null)
...
------解决方案--------------------
探讨

if (session["xxx"] != null)
...