IRequireSessionState doesn't work?

Joined
Aug 16, 2009
Messages
1
Reaction score
0
After we moved to from IIS6 to IIS7 we are not able to run our appliaction. We have a HttpHandler generated by PageParser.GetCompiledPageInstance mehod, but Session is null while generating the page. Here is code example:

namespace Test
{

public class HttpHandlerWithSession : IHttpHandler, System.Web.SessionState.IRequiresSessionState
{
IHttpHandler handler;

public HttpHandlerWithSession(IHttpHandler _handler)
{
handler = _handler;
}

public bool IsReusable { get { return handler.IsReusable; } }

public void ProcessRequest(HttpContext context)
{
handler.ProcessRequest(context); // here context.Session is null
// as well in login.aspx.cs in Page_Load method
//HttpContext.Current.Session is null
// WHY???
}
}

public class PathRewriter : IHttpHandlerFactory
{
public IHttpHandler GetHandler(HttpContext context, string requestType, string url, string pathTranslated)
{
return new HttpHandlerWithSession(PageParser.GetCompiledPageInstance("~/login.aspx", context.Server.MapPath("~/login.aspx"), context));
}

public void ReleaseHandler(IHttpHandler handler)
{ }
}
}


Does anybody know what is wrong? Thx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top