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

后端 未结 6 1812
太阳男子
太阳男子 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:52

    For starters, avoid hardcoded paths to resources like JS or CSS files in your ASP.NET MVC views. Using /Content/Site.css does no better than ../../..

    Use Url.Content helper:

    <%=Url.Content("~/public/scripts/jquery-1.4.2.min.js")%>
    

提交回复
热议问题