jquery - How can I keep all html in session with webservice? -
i want keep full html in page in session using webservice set session step throw exception.
object reference not set instance of object.
my functions
[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 ""; } }
in web methods, make sure enable session
[ webmethod(description="get session",enablesession=true)]
Comments
Post a Comment