开发者

Not able to access session in Httpmodule for static resources like css /js/ image files

开发者 https://www.devze.com 2023-02-24 06:48 出处:网络
I have created a HTTPModule. Session information is retrieved using PreRequestHandlerExecute. It is working well for aspx pages. But while loading css/js or any image files, Session is null.

I have created a HTTPModule. Session information is retrieved using PreRequestHandlerExecute. It is working well for aspx pages. But while loading css/js or any image files, Session is null.

I have gone through the link ASP.NET CSS file not loaded when adding HttpModule to web.config

But could not get the implementation.

Anyone has any idea开发者_开发技巧 about this?


I think you'll find that your static files are being handled by the StaticFileHandler and as such wouldn't fire off session events as the session won't be being activated for efficiency purposes.

You could configure IIS to pass static files through a different handler (the PageHandler for example) but really you'd need to know if that was required first. You haven't described why you want sessions to be available for static files.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号