0

我想知道元属性背后的逻辑是什么。例如在 asp.net 中进行本地化,我们可以使用类似这样的方法来本地化控件:

<asp:Button ID="Button1" runat="server" Text="DefaultText" 
meta:resourcekey="Button1" />

那么什么是逻辑 meta:resourcekey="Button1"。在这个例子中元标记有什么不同的用法吗?

谢谢。

4

1 回答 1

1

用于从 HTML 输出中隐藏您的 asp.net 标记属性

您有一个属性,并且您想在 HTML 输出中隐藏该属性。当您不想在回复中出现多余的垃圾然后使用“meta:”时,它很有用</p>

例子:

<asp:Label id="myLabel" runat="server"  text=”hello”  myattribute="mello"  />

输出是

<span myattribute="mello">hello </span>

使用元:

<asp:Label id="myLabel" runat="server"  text="hello"  meta:myattribute="mello"  />

输出是

<span>hello</span>

来源

于 2010-01-22T17:16:54.597 回答