【发布时间】:2015-05-19 02:36:07
【问题描述】:
我想在使用 webservice 的会话中将完整的 html 保留在我的页面中,但是 设置会话步骤抛出此异常。
对象引用未设置为对象的实例。
我的功能是
[WebMethod(Description = "Gsetsession")]
[ScriptMethod(UseHttpGet = false)]
public void SetSession(string html)
{
HttpContext.Current.Session["html"] = html;
}
[WebMethod(Description = "GetSession")]
[ScriptMethod(UseHttpGet = false)]
public string GetSession()
{
if (HttpContext.Current.Session["html"] != null)
{
return HttpContext.Current.Session["html"].ToString();
}
else
{
return "";
}
}
【问题讨论】:
标签: jquery web-services