ASP.NET元:获取ResourceKey [英] ASP.NET meta:resourcekey

查看:118
本文介绍了ASP.NET元:获取ResourceKey的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在寻找一个ASP.NET应用程序,它使用了大量的荟萃:获取ResourceKey这似乎可以连接到RESX文件

I'm looking at an ASP.NET application which makes heavy use of meta:resourcekey which seem to be connected to the resx files.

这是seeems已经完全从我身边走过的区域。有没有人有益处而这种做法的目的和最佳实践的指导意见?

This is an area that seeems to have completely passed me by. Does anyone have any guidance on the benefits and purpose of this approach and best practices?

推荐答案

元:获取ResourceKey 语法允许您使用隐式资源EX pressions声明语法。这是定位在国际上使用网站时使用。作为快速入门(下面的链接)解释,这几样前pressions的链接到的.resx位于App_LocalResources文件夹中的文件。

The meta:resourcekey syntax allows you use declarative syntax for Implicit Resource expressions. This is used when localizing a site for international use. As the Quickstarts (linked below) explain, these kind of expressions are linked to .resx files located in the App_LocalResources folder.

这种前pression的的好处是,它可以使用多个属性它们在.resx文件代替ASPX本身定义的单个控制

The benefit of this kind of expression is that it can use multiple properties for a single control which are defined in the .resx file instead of the ASPX itself.

例如,采取下列标签:

<asp:Label ID="myLabel" runat="server" Text="This text is localizable" meta:resourcekey="myLabelResource1">
</asp:Label>

该页面的RESX文件可能包含附着标签等多重性能数据:

The resx file for this page could contain data for multiple properties attached to the label such as:

  <data name="myLabelResource1.Font-Name">
    <value xml:space="preserve">Default Font name</value>
  </data>
  <data name="myLabelResource1.Text">
    <value xml:space="preserve">Text in default language.</value>
  </data>
  <data name="myLabelResource1.ToolTip">
    <value>Tooltip in default language.</value>
  </data>

<一个href=\"http://quickstarts.asp.net/QuickStartv20/aspnet/doc/localization/localization.aspx#ex$p$pssions\">The ASP.NET快速入门,如果你想了解这个概念提供了极大的底漆。

这篇关于ASP.NET元:获取ResourceKey的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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