2013-07-06 25 views
1

我试图在Session对象中存储一个url,但它引发了一个错误。会话对象在WebService中抛出异常

 Session["Url"]= linkDetails.Url; 

的URL值显示为

   http://www.mnn.com/earth-matters/space/photos/10-places-on-earth-that-resemble-alien-planets/etosha-pan-namibia 

的例外是

Object reference is not set an instance of the object 
+0

是什么'Session'? –

+2

检查'linkDetails'是否为空 –

+0

否它不为空..值显示在那里 –

回答

1

如果使用Web服务,您必须启用会话吧。

尝试[WebMethod(EnableSession=true)]

+0

谢谢Khanh到 –

+0

@ Sppirals旋转:欢迎,如果你把它标记为接受,很感激。谢谢。 –