Question

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

Était-ce utile?

La solution

I think this will work:

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

Autres conseils

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top