开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜