Reading web.configuration values in asp.net application
- by hima
In my asp.net application I want to read authorization section of web.config and modify that.
For that I am using the below code but I am not getting the values. So have a look at it and let me know if there is any way to read and update authorization section values
AuthorizationSection section;
my section is like the following
<authorization>
<deny users="?"/>
</authorization>
And this is the code:
configuration = WebConfigurationManager.OpenWebConfiguration("~");
section = (AuthorizationSection)configuration.GetSection("system.web/authorization");
SectionInformation sc= section.SectionInformation;
Thanks,
Hima.