HTML 控件的全球化
我如何在 html 控件中实现全球化
,例如:
对于 asp.net 控件,我可以
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" meta:resourcekey="Button1" />
<!-- Explicit Localization -->
<asp:Button ID="Button2" runat="server" onclick="Button1_Click" Text = "<%$ Resources:Sample_aspx, Button1Caption %>"/>
如何在 html 控件(如标签或 html 锚标记)中实现此目的
How can i implement globalization in html control
like for ex:
for asp.net control i can do
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" meta:resourcekey="Button1" />
<!-- Explicit Localization -->
<asp:Button ID="Button2" runat="server" onclick="Button1_Click" Text = "<%$ Resources:Sample_aspx, Button1Caption %>"/>
how do i achieve this in a html control like a label or html anchor tag
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能可以通过多种方式做到这一点...第一种方法是添加
runat="server"
控件,该控件将任何常规控件转换为服务器控件,或者可能使用本地化控件。以下是有关本地化的 MSDN 文章中的示例:
这将从您的资源文件中获取值并放入
h1
标记中,该标记只是常规的 html该链接还包含一些其他对您的问题非常有用的信息...
You could probably do it a number of ways...The first one would be to add the
runat="server"
control which turns any regular control into a server controlor perhaps use the localization control. Here's a sample from the MSDN article on localization:
This would grab the value from your resource file and put in in a
h1
tag which is just regular htmlThat link also has some other pretty useful information to your problem...