Using VS 2017. ASP.NET / VB.NET Web forms app.
I currently have SVG code in my ASP that will hide/show a hyperlink based on conditions in the VB code-behind. The code behind also builds and provides the URL for the link. This code works:
<svg viewBox="0, 0, 1200, 153" preserveAspectRatio="xMinYMin meet" style="position: absolute" >
<%-- Various SVG code for Cirles, Lines, and Text --%>
<%-- NOTE: in order to reference in code behind to set visible=false, you must have 'runat="server"' on <a> tag. --%>
<%-- Code behind will supply the URL and hide show link based on criteria. --%>
<a id="lnkDoc" href="." target="_blank" runat="server">
<text x="738" y="150" text-anchor="start" font-size="11" font-family="sans-serif" text-decoration="underline" fill="#3f48cc" cursor="pointer">
View doc
</text>
</a>
</svg>
Now I no longer can use a hyperlink. I now need a link button or something that will fire event code in the code-behind based on an on-click event.
I have tried adding an "onclick="DocEvent_Click" to the <text> tag above and that did not work. I then replaced the <a> tag above with this code:
<a id="lnkDoc" href="." target="_blank" runat="server" visibility="visible">
<asp:LinkButton ID="btnDoc" runat="server" x="1055" y="150" Font-Underline="True" OnClick="DocEvent_Click" >View doc</asp:LinkButton>
</a>
It also did not work. It does not even show the "View doc" text.
What is the easiest way I can add Text inside of the SVG tags that will fire an event in the VB code-behind when clicked?
(NOTE: I also need to be able to show / hide the text based on a condition in the code- behind.)
Thanks
Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.