Hello MCM,
Yes, you are right about purpose of configSections. Let me do some future
clarifications.
From the MSDN document
http://msdn.microsoft.com/en-us/library/ms228256.aspx , we know that the
configSections element is required because ASP.NET makes no presumptions
about how to handle settings within a configuration file. Instead, ASP.NET
delegates the processing of configuration data to configuration section
handlers.
To understand about the above description better, let us do the following
test:
1.Firstly, we create an empty web application, and open the Web.config file
in Visual Studio. We will see the configSections you post above.
2.We type "<test></test>" right behind the configSections element, and
press F5 to debug the application. We will receive an error says
"Unrecognized configuration section test."
3.We replace the text "<test></test>" with the text
"<system.web.extensions></system.web.extensions>", and then I press F5 to
debug. Everything works fine.
The reason is that if we want to use a kind of element, we firstly need to
declare it in the configSections element. ("test" is not declared, while
"system.web.extensions" is, in the configSections in the above experiment).
As to your question: why we can use the <system.web> as well as other
elements without declaring them in the configSections? The reason is we
have a machine.config file which defines the default elements for us. We
can find this file in this location:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\. You can use the
notepad to view its content.
To know more about how to use <system.web.extensions> configuration, please
refer this link:
http://www.asp.net/AJAX/documentatio...SPNETAJAX.aspx
Best regards,
Ji Zhou (v-jzho@xxxxxx, remove 'online.')
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxx.
This posting is provided "AS IS" with no warranties, and confers no rights.