user1395543
user1395543

Reputation:

ConfigurationManager.AppSettings in jQuery

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

Answers (1)

TRR
TRR

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

Related Questions