We can set the keys values of <appSetting> in a reference file. The procedure is:
Add a new item i.e. web configuration file from solution explorer name it keys.config(you can name it our own).
write the following code in keys.config:-
In the web.config file set the reference of the keys.config file as follows:-
We are finished with the reference stuff. Now we can access the values for key value1 and value2 in the code file by following code lines:-
Add a new item i.e. web configuration file from solution explorer name it keys.config(you can name it our own).
write the following code in keys.config:-
In the web.config file set the reference of the keys.config file as follows:-
We are finished with the reference stuff. Now we can access the values for key value1 and value2 in the code file by following code lines:-