How to read Telerik appSettings from an external file
Load the Telerik appSettings flags from an external file.
The UI for ASP.NET AJAX controls provide [a lot of switches and settings you can set from the appSettings section in the web.config](/devtools/aspnet-ajax/general-information/web-config-settings-overview#control-properties-you-can-set-from-the-webconfig. In some cases you may want to declutter the web.config file and read these settings from a separate file. This can even facilitate deployment and testing, especially if you also use your own flags in the appSettings section.
ASP.NET allows you to import sections of the web.config file from an external file that is under the same folder. To do this:
- copy the
appSettingssection in your desired configuration file (e.g., in ~/App_Data/myAppSettings.config)
- remove the contents of the
- set the
configSourceattribute of the
appSettingstag to point to the external file (configSource="App_Data\myAppSettings.config"). Note the backslash that denotes a physical path.
You can find attached a small example below. Just add the Telerik assemblies to the
- MSDN: Using External Configuration Files
- How to encrypt the Telerik appSettings keys
- Telerik Control Properties You Can Set From the web.config
A sample project that demonstrates the approach can be found attached here: