I have a asp:Hyperlink with a data-attribute containing a value (a number in this case).
<asp:HyperLink ID="hypTest" href="testwebsite.com" CssClass="button-close" data-test="1" runat="server" Text="Testlink" onclick="dosomething"></asp:HyperLink>
How can I access the data attribute from this HyperLink in the codebehind when a user clicks that exact link. (there will be multiple similar links)
Also note that the onclick shown above does not work for me.
It does not access the dosomething method.
protected void dosomething()
{
//get the data-test value
}
What would be the best way to achieve this?
Thanks in advance.