Server.Transfer() and Session unavailable

R

Rick Strahl [MVP]

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
code transfers fine, but the page transferred to does not have a Session
object. Neither this.Session or this.Context.Session are defined. Oddly
enough if the page I transfer to is in the same directory it works just
fine.

Note this is not another virtual directory, but just a sub in the
application.

It looks like the Session object is scoped to a specific directory and is
simply not there if I transfer elsewhere. In fact if I put a Trace on the
transferred page Session ID shows blank (but only if I transfered into
another directory).

Bug or feature?


This has caused some weird problems for me as I'm using this for a generic
error display page that can be called from anywhere. A bitch to find this
out as the error was actually firing way down in the guts of a control
that's retrieving some session state. Since the use of session state in this
page is minimal this works Ok, but in a more complex scenario this really
would screw things up...

Any ideas how this could be worked around?


+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/wwHelp
 

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,999
Messages
2,570,243
Members
46,838
Latest member
KandiceChi

Latest Threads

Top