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

How to get code from a published ASP.Net build where we don't have source code?

If you have ever lost or misplaced your source code for an ASP.Net web application, you might wonder if there is a way to recover it from th...