ASP.NET Membership: CSS being blocked by Deny users, page doesn't render correctly?

后端 未结 6 1866
太阳男子
太阳男子 2021-01-12 07:04

I have a page that functions correctly but when i issue a deny user for the whole site it redirects me to the logon page which seems to work BUT the css is not working. Henc

6条回答
  •  盖世英雄少女心
    2021-01-12 07:35

    Try removing the tilda (~) in your location's path attribute. If you look at the fiddler result, its a callback request for your css. so the unauthenticated request for the page is in turn making unauthenticated requests for resources (the css).

    I generally try to place a styles directory at the root of the application, and then use a helper tool like T4MVC or my own helper methods to translate and avoid having to figure out the ../../ directory crawling.

提交回复
热议问题