是否有可能与ASPX,C#和JavaScript字符串之间共享一个文件? [英] Is it possible to share ONE file with strings between ASPX, C# and JavaScript?

查看:87
本文介绍了是否有可能与ASPX,C#和JavaScript字符串之间共享一个文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想所有外部化在项目中使用到一个文件中的字符串,并能够使用它里面的aspx,C#code后面的JavaScript中的客户端。

我想这样做的原因是因为许多字符串是共享的,即在两个地方是相同的。

I'd like to externalize all of the strings used in the project into one file and be able to use it inside aspx, C# code behind and on the client side in JavaScript.
The reason I want to do it is because many strings are shared, i.e. the same in two places.

这可能吗?有没有更好的办法?

Is it possible? Is there a better way?

推荐答案

JSON 是一个不错的选择 - 一个类似的问题:<一href=\"http://stackoverflow.com/questions/239832/how-do-you-share-configuration-information-or-business-rules-between-languages\">How你共享语言之间的配置信息或业务规则

JSON is a good fit - a similar question: How do you share configuration information or business rules between languages

这篇关于是否有可能与ASPX,C#和JavaScript字符串之间共享一个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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