开发者

Static file in MonoRail can not be loaded in Forms Authentication mode

开发者 https://www.devze.com 2023-03-22 09:23 出处:网络
I applied Forms authentication to my monorail project. In login page, all static files can not be loaded. It seems that the static file can be loaded only after user logged in. In login page, the req

I applied Forms authentication to my monorail project.

In login page, all static files can not be loaded. It seems that the static file can be loaded only after user logged in. In login page, the request to script.js is redi开发者_运维知识库rected to

http://localhost:49529/MySite/Login/Index.rails?ReturnUrl=%2fMySite2fContent%2fjs%2fscripts.js

Thanks for any help.


If you go extension less path and register "*" request to go through MonoRail this might be the case.

Try to add StaticFileHandler before MonorailHttpHandlerFactory setting like this:

<add verb="*" path="*.pdf" type="System.Web.StaticFileHandler"/>
<add verb="*" path="*.zip" type="System.Web.StaticFileHandler"/>
...
<add verb="*" path="*" 
  type="Castle.MonoRail.Framework.MonoRailHttpHandlerFactory,
    Castle.MonoRail.Framework"/>
0

精彩评论

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