locked
Is Session Object aveilable in the "ashx" context??? RRS feed

  • Question

  • User1954630082 posted

     

    when my deploying a cunstom httphandler,  i found that the Session object could not be referrenced in the ProcessRequest(HttpContext context)  method. It is null. (  context.Session == null )

     

    who can tell me why?

    Thursday, January 19, 2006 12:07 AM

All replies

  • User-1372641848 posted

    If you want to access Session state from your handler then Along with IHttpHandler your handler must inherit from IRequiresSessionState.

    .......

    using System.Web.SessionState;

    public class MyHandler : IHttpHandler,IRequiresSessionState {

    ......

    }

     

    Thursday, January 19, 2006 12:26 PM
  • User1954630082 posted
    thanks for your reply!
    Friday, January 20, 2006 1:23 AM