Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Allowing access to my Site.Css on my login form MVC

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>

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

like image 614
Hriskesh Ashokan Avatar asked Dec 06 '22 19:12

Hriskesh Ashokan


1 Answers

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

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

like image 90
brodie Avatar answered Dec 22 '22 21:12

brodie