在 ASP.NET 中本地化单选按钮

发布于 2024-11-24 00:45:45 字数 148 浏览 2 评论 0原文

如何根据全局资源文件中包含的字符串来本地化单选按钮项?我已成功通过编辑 (Expressions).Text 属性来引用此全局资源文件来本地化标签和按钮,但我似乎无法对单选按钮或其他列表执行此操作基于控制。我是否必须以编程方式绑定它们,或者有更好的方法吗?

How do you go about localising radio button items based on strings contained in a global resource file? I have managed to localise labels and buttons by editing the (Expressions).Text property to refer to this global resource file, but I can't seem to be able to do it for radio buttons or other list-based controls. Do I have to bind them programmatically or is there a better way to do it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

独自唱情﹋歌 2024-12-01 00:46:01

我认为你的表达不正确,因为你没有向我们展示。我们在使用时,本地资源和全局资源是有区别的。

下面是如何获取全局资源

Text="<%$ Resources:GlobalRes, NameOfKey %>"

I think your expression is not correct as you have not shown to us. There is difference between Local and global resources when we use..

here is how to Get Global Resources

Text="<%$ Resources:GlobalRes, NameOfKey %>"
|煩躁 2024-12-01 00:46:01

通过本地化基于列表的控件,最好的“短棒”选项是以正确的语言绑定到数据集。我确信您可以创建一个从列表派生的类并以另一种方式控制它,但在绑定之前调整数据是最快的方法。我不知道有什么“更好”的方法。

With localising list based controls, you best "short stick" option is to bind to the data set in the proper language. I am sure you could create a class derived from the list and control it another way, but massaging the data prior to bind is the quickest method. I don't know of a "better" way.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文