Wednesday, 27 February 2013

ASP.NET: Setting Key Values In Reference Config File

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:-


ASP.NET: Setting Key Values In Reference Config File

In the web.config file set the reference of the keys.config file as follows:-

ASP.NET: Setting Key Values In Reference Config File
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:-

ASP.NET: Setting Key Values In Reference Config File

No comments:

Post a Comment

WooCommerce an WordPress open-source e-commerce plugin

WooCommerce is an WordPress open-source e-commerce plugin. WooCommerce is a free WordPress plugin that have e-commerce functionality to your...