views:

41

answers:

2

Is there an easy way to do this?

A: 

You can use forms authentication which allows you to specify if authenticated users can access pages by groups.

Unless of course you mean "real" directories that contain files. What are you securing? The file system, or the paths to the pages?

Nick DeVore
I would like to password protect a directory called /admin
Will
+1  A: 

In your web.config, you can use the following:

<location path="AdminDirectory">
    <system.web>
        <authorization>
            <allow roles="Administrators"/>
            <deny users="*"/>
        </authorization>
    </system.web>
</location>

See here: msft.

Forgotten Semicolon
You also need to set up auth and roles.
SLaks