让我的登录表单MVC访问我的site.css [英] Allowing access to my Site.Css on my login form MVC

查看:240
本文介绍了让我的登录表单MVC访问我的site.css的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要我的CSS来显示我的登录页面,但它不是在此刻呈现。我怎么会去允许用CSS访问我的登录页包括在内?即时通讯使用窗体身份验证,并为我的web.config文件我的code座看起来这样的:

I need my css to show for my login page, but it's not showing at the moment. How would I go about allowing access to my login page with the css included? Im using forms authentication, and my code block for my web.config file looks as such:

<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路径。我该如何将它添加到允许访问此文件对所有用户?

My site.css is in my /Content/Site.css path. How do I add it to allow access to this file to all users?

推荐答案

&LT;拒绝用户= /&GT?; 拒绝匿名用户访问的css文件。 (这里阅读

the <deny users="?"/> denies anonymous users from accessing the css file. (read here)

所以你需要把以下到您的&LT;结构&gt; 的web.config中块

so you'll need to put the following into your <configuration> block within web.config

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

您可以阅读一些关于这里

you can read some more about this here

这篇关于让我的登录表单MVC访问我的site.css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆