Reputation:
I am using mvc3 c#. And the appsettings from the config manager works fine in the controllers. But I want to use these constants in my jquery.
Is there a way to use the ConfigurationManager.AppSettings in jQuery?
Thanks in advance.
Upvotes: 3
Views: 9605
Reputation: 1643
Hope this works for you:
var appSetting = '@(System.Configuration.ConfigurationManager.AppSettings["Test"].ToString())'
Where Test
is the key you want to access
Upvotes: 5