HttpHandlers, Server.Transfer and Session State

F

Fernando Rodriguez

I created an HttpHandler for rewritting URLs.
It simply checks if the requested page is on a list of "special" pages (that
do not exist) and if it is on the list then it will transfer to an ASPX page
that will generate the content dynamically.

The problem is that after the call to Server.Transfer or Server.Execute the
page i'm transfering to throws an exception when it tries to access the
Session object. The error says that I must set enableSessionState to true on
the page directive or the pages tag on the web.config. Obviously they are
both set to true.

I also implemented IRequiereSessionState on my HttpHandler but it did not
make a difference.

Any suggestions?
 
B

bruce barker

you are probably doing the transfer before session is loaded. why are you
doing server transfer anyway? why not RewritePath.

-- bruce (sqlwork.com)
 
N

news.microsoft.com

Thanks. If I use rewrite path it will postback to the page dynamic page url.

The session was already loaded, I tested it before the transfer call.

What I ended up doing was use PageParser to create an instance of the
compiled version of the .ASPX file and then call it's ProcessRequest method.
That's how it's done by the built-in handler.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top