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
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