I just found a way to mention configuration on a page basis, so the configuration only applies to that page.
Just include any specific configuration under Location element that you would like to apply to a single page. Keep the following points in mind when using this approach.
- Set an appropriate value for the path attribute of location element. Path can be a relative path.
- The location element must be outside the system.web and system.webserver and any other sections within web config
Location is a section by itself in a web.config file.
In my case the following worked, where I specified a Location section for the single page for which I wanted to specify special configuration:
<?xml version="1.0"?>
<configuration>
//all sections in web config go here. Put the Location elements always
// at end of your web config file
<location path="Page1.aspx">
<system.web>
<browserCaps>
<case>
RequiresControlStateInSession=true
</case>
</browserCaps>
</system.web>
</location>
</configuration>