How to Get Key Value from Web.config File

968
get key value from web.config

Keywords | get key value from web config in javascript, get key value from web config c#, get key value from web config in jquery, get key value from web.config mvc

Get Key Value from Web Config ASP.Net

ASP.NET Web.config file allows you to define or revise the configuration settings at the time of developing the application or at the time of deployment or even after deployment. The following are brief points that can be understood about the Web.config file:

  • Web.config files are stored in XML format which makes us easier to work with.
  • You can have any number of Web.config files for an application. Each Web.config applies settings to its own directory and all the child directories below it.
  • The changes in Web.config don’t require the reboot of the web server.

An appSettings element in the root Web.config file that looks like the following:

In this asp.net MVC blog post I will demonstrate, how to Access key value from the Web.config file.

Get key value from web.config in JavaScript

Find the below code to learn how can I read a key value from web.config in a javascript file. –

Get key value from web.config MVC

Find the below code to Get Key Value From Web Config in ASP.Net MVC:-

Find the full source code below:-

Demo

Download Code

What do you think?

I hope you liked this article. I would like to have feedback from my blog readers. Your valuable feedback, question, or comments about this article are always welcome.

LEAVE A REPLY

Please enter your comment!
Please enter your name here