|
|
|
Although ASP.NET lets you distribute web.config files over all the application's subdirectories, it surely doesn't force you to do so. You can keep all the application settings in its main web.config file, while enforcing different settings on a directory-by-directory base, if you want. The key to this useful feature is the tag.
For example, let's see how an application's configuration file can specify different authorization settings for its different subdirectories. This web.config file enforces the same settings as the example seen in previous section: |
Click here to copy the following block | <configuration> <system.web> <authorization> <allow roles="MyDomain\Administrator" /> <deny users="*" /> </authorization> </system.web>
<location path="/Public"> <system.web> <authorization> <allow users="?" /> </authorization> </system.web> </location> </configuration> |
You can use a tag also in machine.config to affect settings in individual ASP.NET applications and their subdirectories. In this case, the path attribute must begin with the IIS site name, as read in the MMC snap-in. For example, here's how you can enable tracing for the .aspx files in the /MyApp virtual directory of the default Web site: |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
 |

|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|