Session state is not available in this context - webresource.axd ?

  • Thread starter Thread starter kingski
  • Start date Start date
K

kingski

I have a web page (Asp.net 2.0, vs2005) in which there is this construction:

<img src="/pages/showimage.aspx">

In global.asax I access sessions in Application_PreRequestHandlerExecute
event.



When I try to access the page through browser this error is appear:

--------------------------------------------------------------------------------------------------------------------------------------------



Error in:
https://localhost/webresource.axd?d=uEFsL08R9RMWYZ7QhLYv4Q2&t=632717878583701558

Error Message:Session state is not available in this context.

Error Source: System.Web

Error TargetSite:System.Web.SessionState.HttpSessionState get_Session()

Error InnerException:



If I remove "<img src="/pages/showimage.aspx">" the page works ok.





Any idea what can cause such behavior?
 
you are trying to access the session data before its been loaded, as this is
done by the handler.

-- bruce (sqlwork.com)
 

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

Back
Top