Monday, March 26, 2012

Access Session in WebMethod

I am trying to access the Session from an ATLAS WebMethod. My session is always equal to null. I am calling the method from javascript. How do I access the session?

[WebMethod]

publicbool DoStuff()

{

if (Session["Data"] !=null)

{

}

Thanks

You need to use [WebMethod(true)] to enable the session from that web method.

No comments:

Post a Comment