I want to keep that full html in my page in session using with webservice but set session step throw this exception.
Object reference not set to an instance of an object.
My functions are
[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 "";
}
}