views:

65

answers:

2

Hello,


A) We can also control access to specific files using <location> tags. Why aren’t <location> elements contained inside <system.web> tag, but are instead nested directly inside <configuration> element?


B) I realize <system.web> element is used for Asp.Net settings, but why does <location> also contain <system.web>? Is it so that it specifies settings specified inside <system.web> are applied only for when file is included in Asp.Net application?

If so, then that would suggest that <location> element could be used for non-Asp.Net applications also?


thanx

+1  A: 

The thing is that <system.web> is not the only element that affects ASP.NET applications. <location> can override some of the defaults for certain pages. Here's a sample from MSDN:

<configuration>
    <location path="UploadPage.aspx">
        <httpRuntime maxRequestLength="128"/>
    </location>
</configuration>
DreamSonic
But still, why isn't <location> contained inside <system.web>? Is it ( as McBee suggested ) due to <location> also being used for non-Asp.Net applications?
SourceC
+1  A: 

guessing wildly

was almost certainly meant to be bound up with Code Access Security, which can use URLs as a membership condition for a code group. I don't think this was fully expressed or implemented in .NET, but it means the same schema could have been used for non-ASP.NET scenarios.

Alan McBee