문제

I am making some modifications to a website, but it is hosted by a third party so I don't have code-behind access, how can I add custom HTML attributes (Rich Snippets) to an ASP label or other element?

Code: <asp:Label ID="lblPositionTitle" runat="server"></asp:Label>

Thank you in advance

도움이 되었습니까?

해결책

I think this will work:

<asp:Label ID="lblPositionTitle" runat="server" richAttribute="value"></asp:Label>

다른 팁

Is jquery available? ... just add the attribute like:

<script> 

$("#<%=lblPositionTitle.ClientID%>").attr("newAttributeName", "theValue"); 

</script> 

Is using HTML5, you can use the data-* attribute: https://www.w3schools.com/tags/att_global_data.asp

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top