使用session时出现Object reference not set to an instance of an object.如何解决

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

使用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)
...