gpt4 book ai didi

html - 允许在我的登录表单 MVC 上访问我的 Site.Css

转载 作者:搜寻专家 更新时间:2023-10-31 02:25:03 26 4
gpt4 key购买 nike

我需要我的 css 来显示我的登录页面,但它目前没有显示。我将如何允许访问包含 css 的登录页面?我正在使用表单例份验证,我的 web.config 文件的代码块如下所示:

<authentication mode="Forms">
<forms loginUrl="UserAccount/Login" defaultUrl="UserAccount/Index" timeout="60"></forms>
</authentication>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>

我的 site.css 在我的/Content/Site.css 路径中。如何添加它以允许所有用户访问此文件?

最佳答案

<deny users="?"/>拒绝匿名用户访问 css 文件。 (阅读 here)

因此您需要将以下内容放入您的 <configuration>在 web.config 中阻止

<location path="Content">
<system.web>
<authorization>
<allow users="?"/>
</authorization>
</system.web>
</location>

您可以阅读更多有关此内容的信息 here

关于html - 允许在我的登录表单 MVC 上访问我的 Site.Css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7383242/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com