Global.asx 和 CSS 之间的冲突

发布于 2024-09-14 21:39:01 字数 242 浏览 7 评论 0原文

我需要限制多个用户登录我的系统。我正在 global.asax 中使用 Application_OnPostAuthenticateRequest 事件来查看是否有人登录。它工作得非常好。

但 CSS 没有加载,屏幕看起来很糟糕。如果我在该事件中注释掉代码,页面就会完美呈现......

我错过了什么? Application_OnPostAuthenticateRequest 与 CSS 有什么关系?

非常感谢您的帮助

I need to restrict multiple users from logging into my system. I am using Application_OnPostAuthenticateRequest event in global.asax to see if anybody is logged in. It works really well.

But CSS is not loading and the screen looks horrible. If I comment out the code in that event, the page renders perfectly...

What am I missing? What does Application_OnPostAuthenticateRequest has anything to do with CSS??

Thanks a lot for the help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

习惯成性 2024-09-21 21:39:01

将 css 移动到包含以下 web.config 的文件夹

<system.web>
  <authorization>
    <allow users="*"/>
  </authorization>
</system.web>

,然后更改标题文本以指向新的 css 位置。如果您使用主题,只需将 web.config 文件添加到您的主题文件夹中即可。

注意:这会覆盖您的安全设置,并允许每个人访问包含附加 web.config 文件的文件夹。这还包括子文件夹

Move your css to a folder that contains the following web.config

<system.web>
  <authorization>
    <allow users="*"/>
  </authorization>
</system.web>

Then change your header text to point to the new css location. If you ar using themes simply add the web.config file to you theme folder.

Note: This overrides your security settings and allows everyone access to the folder containing the additional web.config file. This also includes sub folders

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文