Here Mudassar Ahmed Khan has explained with an example, how to read (get) value from the AppSettings section of the Web.Config file in JavaScript in ASP.Net MVC Razor.
It is not possible to read the AppSetting value directly in JavaScript and hence using jQuery, an AJAX call will be made to the Controller’s Action method which will read the AppSetting value and return it to the JavaScript function.
↧