Authorization with the built-in VS 2005 Web Server (aka Cassini)
page 3 of 4
by Scott Guthrie
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 16236/ 56

How to Fix This

Fixing this is pretty easy. Just add a new authorization rule to your root web.config site that grants access to the stylesheet and/or other file resources that you want to allow anonymous access to.  For example, the below configuration section denies access to all resources except stylesheet.css:

Listing 2

<system.web>
   <authorization>
       <denyusers="?"/>
   </authorization>
</system.web>
<location path="stylsheet.css">
    <system.web>
       <authorization>
           <allow users="*"/>
       </authorization>
    </system.web>
</location>

Alternatively, if you have a directory with a lot of static files in it, you can just add a web.config file at its root and add a global authorization rule like above allowing access to it. 

Hope this helps,

Scott


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2019 ASPAlliance.com  |  Page Processed at 2019-11-17 10:50:00 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search