Session对象是一个WebService引发异常 [英] Session object is throwing exception in a WebService

查看:170
本文介绍了Session对象是一个WebService引发异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图存储在Session对象的URL,但它抛出一个错误。

 会话[网址] = linkDetails.Url;

地址值被示出为

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

异常是

 对象引用未设置对象的实例


解决方案

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

尝试 [的WebMethod(EnableSession = TRUE)]

I am trying to store a url in Session object but it is throwing an error.

      Session["Url"]= linkDetails.Url;

the Url value is shown to be

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

the exception is

  Object reference is not set an instance of the object

解决方案

If you use web service, you have to enable session for it.

Try [WebMethod(EnableSession=true)]

这篇关于Session对象是一个WebService引发异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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