jQuery中ConfigurationManager.AppSettings [英] ConfigurationManager.AppSettings in jQuery

查看:253
本文介绍了jQuery中ConfigurationManager.AppSettings的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用MVC3 C#。而从配置管理器中的AppSettings工作在控制器的罚款。但我想在我的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.

有没有办法使用jQuery中的ConfigurationManager.AppSettings的方法吗?

Is there a way to use the ConfigurationManager.AppSettings in jQuery?

在此先感谢。

推荐答案

希望这对你的作品:

 var appSetting = '@(System.Configuration.ConfigurationManager.AppSettings["Test"].ToString())'

其中,测试是您要访问的关键

Where Test is the key you want to access

这篇关于jQuery中ConfigurationManager.AppSettings的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆