views:

251

answers:

2

I started using dotless css in my asp.net site which requires a special httphandler to work. The site uses Forms Authentication. Here's the problem: When I'm logged in the request to http://mysite.com/stylesheets/mystyles.less works fine. It gives me back the appropriate css. If I'm not logged in the request is denied and I'm redirected to the login page. Is there a way to allow this file to be accessed anonymously? This is not working:

<location path="~/stylesheets">
    <system.web>
        <authorization>
            <allow users="*" />
        </authorization>
    </system.web>
</location>
A: 

Not sure if this is the problem but you're missing a quote mark in your xml.

<location path="~/stylesheets">
Shawn Steward
I just typed it into the question wrong.
Micah
+1  A: 

The problem is with the path syntax.

This does not work:

<location path="~/stylesheets">
    <system.web>
        <authorization>
            <allow users="*" />
        </authorization>
    </system.web>
</location>

This DOES work:

<location path="stylesheets">
    <system.web>
        <authorization>
            <allow users="*" />
        </authorization>
    </system.web>
</location>
Micah