P
PJ
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
handler handles the request and calls context.Server.Transfer to an actual
..aspx page. However, the first call to Session in the page throws an
exception: Session state can only be used when enableSessionState is set to
true, either in a configuration file or in the Page directive.
I do not receive this error if I use context.Response.Redirect or if I
access the page directly.
The MSDN article (
http://msdn.microsoft.com/architect...s/dnpatterns/html/ImpFrontControllerInASP.asp )
on this pattern uses Server.Transfer, but the web handler is set up to
handle .aspx pages. One of the benefits I derive from the use of this
pattern is the ability to decouple the url navigation from actual .aspx
pages, so I would rather not do that.
What is the cause of this expection? Can I not use Session for non .aspx
pages even if I have a web handler to process these requests?
TIA~
PJ
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
handler handles the request and calls context.Server.Transfer to an actual
..aspx page. However, the first call to Session in the page throws an
exception: Session state can only be used when enableSessionState is set to
true, either in a configuration file or in the Page directive.
I do not receive this error if I use context.Response.Redirect or if I
access the page directly.
The MSDN article (
http://msdn.microsoft.com/architect...s/dnpatterns/html/ImpFrontControllerInASP.asp )
on this pattern uses Server.Transfer, but the web handler is set up to
handle .aspx pages. One of the benefits I derive from the use of this
pattern is the ability to decouple the url navigation from actual .aspx
pages, so I would rather not do that.
What is the cause of this expection? Can I not use Session for non .aspx
pages even if I have a web handler to process these requests?
TIA~
PJ