Tuesday, April 14, 2015

Opening two windows on Hyperlink click

Sometimes, we may require to open two windows on one Hyperlink click.

We can achieve this easily with button control by mentioning on link on client side scripting and the other on server side coding. But when we have to use Hyperlink, the simplest way to achieve this is as follows -

<a runat="server" href="http://www.google.com" onclick="window.open('http://www.yahoo.com');" >click Me</a>


We can execute above code and after clicking on the link two different windows will open one for http://www.google.com and the other for http://www.yahoo.com


Happy Coding !

No comments:

Post a Comment