views:

17

answers:

2

Hello,

I have a project containing an image, css and js folder.
I want to make sure no css, image or js is blocked when using formsauthentication.

I know you can do this with the locationtag in the web.config but I was wondering if you could do this otherweise?

this is how I do it right now:

<location path="css">
        <system.web>
            <authorization>
                <allow users="*"/>
            </authorization>
        </system.web>
    </location>
    <location path="images">
        <system.web>
            <authorization>
                <allow users="*"/>
            </authorization>
        </system.web>
    </location>

I'm using asp.net (c#) with iis 7.0.

Cheers, M.

+1  A: 

Set the folder permissions for your CSS/images directories, to allows anonymous access.

This is done in the web.config, not filesystem permissions.

leppie
yeah, I know that's what I mentioned in the question. but I wanted to know if there was any other way.
Sem Dendoncker
A: 

It is a good practice to serve static resources such as images and css from a cookie-free domain.

Darin Dimitrov