Today, I tried to control a html link with a tag and a function (in c#) like the following,
<a href="<%#GetTopLink(Eval(FN_URL).ToString())%>"><%#Eval(FN_NAME)%></a>
protected string GetTopLink(string vUrl)
{
if (<true>)
return vUrl;
else
return "javascript: window.open('" + vUrl + "','new'); void(0);";
}
It doesn't seems it's a very smart way. A reminding to myself,
<a href="http://www.microsoft.com" target="_blank">go</a>
<a href="http://www.microsoft.com" target="_self">go</a>
<a href="javascript: window.open('http://www.microsoft.com', '_blank'); void(0);">go</a>