Last post Mar 01, 2018 03:26 PM by psm12se
Feb 27, 2018 08:00 PM|psm12se|LINK
Can anyone help in how to access the below custom config section in the web.config file using C#.
Feb 28, 2018 12:30 AM|oned_gk|LINK
XmlDocument doc = new XmlDocument();
or use appsetting section
string str = System.Configuration.ConfigurationManager.AppSettings["dailyCleanup"].ToString();
Feb 28, 2018 05:52 AM|Eric Du|LINK
According to your description, as far as i know, you want to access the custom config section, here is a tutorial about how to set and how to access custom config section, please check:
How to: Create Custom Configuration Sections Using ConfigurationSection:
How to read values from custom section in web.config:
Feb 28, 2018 05:49 PM|psm12se|LINK
That was helpful. I was able to access the custom config in C# through the links you provided.
Thanks oned_gk for the reply, I was looking for another solution provided by Eric.
Mar 01, 2018 03:26 PM|psm12se|LINK
I was able to access the custom config in C# for the below format using the helpful links that you posted;
<cleanupTasksSection> <!-- Config Section -->
<cleanupTasks> <!-- Collection -->
But was just wondering if the cleanupTasksSection xml tag is required at all. I mean for the below xml config format where the config section and collection are the same thing.
<cleanupTasks> <!-- Config section and collection are same here -->
Let me know your thoughts.