Sams Teach Yourself ASP.NET in 21 Days, Second Edition By Chris Payne
Table of Contents
Day 18. Configuring and Deploying ASP.NET Applications
Can I retrieve the predefined sections from web.config using the GetConfig method? Such as <sessionState>?
This task is, unfortunately, a very difficult one. The handlers that ASP.NET uses to parse most of the predefined sections don't return objects that you can easily use. Most of them are declared as private, which means that they are inaccessible from your ASP.NET pages. This prevents most attempts at accessing them.
See the .NET SDK documentation for further details.
Will web.config security settings protect all resources?
No, it will protect only resources that are processed by ASP.NET. Therefore, .gif, .jpg, .txt, and other files would all still be accessible by users. I'll discuss this topic more in Day 21.