如何使用代码隐藏设置数据属性?
ASP.NET
<asp:Label ID="lbl" runat="server" Text="Value" />
<asp:Panel ID="pnl" runat="server" />
VB
lbl.Text = "Text"
pnl.Attributes("data-attribute") = "200"
//Is this correct?
所需标记
<span id="lbl">Text</span>
<div id="pnl" data-attribute="200">Value</div>
最佳答案
pnl.Attributes("data-attribute") = "200"
关于c# - 如何使用 ASP.NET 设置数据属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26804968/