473,606 Members | 3,100 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 enableSessionSt ate to true on
the page directive or the pages tag on the web.config. Obviously they are
both set to true.

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

Any suggestions?
Jun 27 '08 #1
2 3035
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 enableSessionSt ate to true on
the page directive or the pages tag on the web.config. Obviously they are
both set to true.

I also implemented IRequiereSessio nState 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*********@di scussions.micro soft.comwrote in message
news:1E******** *************** ***********@mic rosoft.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 enableSessionSt ate to true
on
the page directive or the pages tag on the web.config. Obviously they are
both set to true.

I also implemented IRequiereSessio nState 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
2234
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 site on its own, so I will end up having two web sites. This planned to aid problems we've been having with performance, as if the portion (which is an app in its own right) has problems we then have to restart the whole site and so bring everything...
0
1042
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 current app. For example, the current page is /myApp/Admin/somepage.aspx and the virtual root and the page i want to access is in /myApp/MessageDisplay.aspx. The
2
3745
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 PictureGallery.aspx?id=30 to display gallery 30. In this way I have a database driven picture gallery. To improve indexing, I put code in Global.asax to allow me to get to the same page with a url like this: Pictures_30.aspx. There is no...
2
1930
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 have enabled default documents for the web app and set the top entry to default.ptv and have created blank files in all of the directories named default.ptv. The client initially requests a page with a url like www.domain.com/admin/ and the...
6
3778
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 one day): \\FFDS24\ASP.NET Applications(_LM_W3SVC_1_Root_ATV2004)\Errors During Execution: 7 \\FFDS24\ASP.NET Apps v1.1.4322(_LM_W3SVC_1_Root_ATV2004)\Compilations
23
6784
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. How can I accomplish this. I don't think redirects with session state being passed in the url makes any sense from a security standpoint. -- Barry
2
6943
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 attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
0
1605
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. My problem is mostly understanding the ASP part and Server.Transfer oddities I'm experiencing. I have posted before about this project's problems but since I have recoded everything to implement Server.Transfer, figured its probably best to start a...
0
8036
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
7978
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8317
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6796
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5987
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5470
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3948
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2454
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1572
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.