I have this href link in a control that calls a javascript and pass the variable to it:
<a href="<%#XPath("link").ToString()%>" onclick="return getLink(this)">Link</a>
I need to stop it opening the browser. How can I do that?
event.preventDefault();
will prevent the default behaviour of the click on the element.
So:
<a href="<%#XPath("link").ToString()%>" onclick="event.preventDefault(); return getLink(this)">Link</a>