473,378 Members | 1,066 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

HttpHandlers, Server.Transfer and Session State

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?
Jun 27 '08 #1
2 3021
you are probably doing the transfer before session is loaded. why are you
doing server transfer anyway? why not RewritePath.

-- bruce (sqlwork.com)
"Fernando Rodriguez" wrote:
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?
Jun 27 '08 #2
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.
"bruce barker" <br*********@discussions.microsoft.comwrote in message
news:1E**********************************@microsof t.com...
you are probably doing the transfer before session is loaded. why are you
doing server transfer anyway? why not RewritePath.

-- bruce (sqlwork.com)
"Fernando Rodriguez" wrote:
>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?

Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: StephenMcC | last post by:
Hi All, Got a quick query in relation to the Server.Transfer method available in IIS 5+/ASP. I've got an issue where I want to take a portion of an online app and extract this out into a web...
0
by: Rick Strahl [MVP] | last post by:
Hi all, Has anybody run into this scenario: From within a page I use a Server.Transfer() to run another ASPX page. The other ASPX page however is not in the current directory but a sub of the...
2
by: David Berman | last post by:
It seems that my site is losing session information when using Server.Transfer. I have a page called PictureGallery.aspx. It takes an argument which is an index id, so it would look like...
2
by: PJ | last post by:
I'm trying to set up a front controller pattern in my web application but having Session issues when using Server.Transfer. I have created a web handler that processes requests for .ptv files. I...
6
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for...
23
by: barryfz | last post by:
I need to be able to move from one web app on my server to another on the same server and preserve the session state. I have played with server.transfer but I get an error saying I can't do this....
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
0
Frinavale
by: Frinavale | last post by:
Platform: WindowsXP and IIS Language: Asp .NET (using Visual Basic back end) I'm not sure if anyone will be able to understand my code because its written using ASPX and Visual Basic back end. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.