Open multiple URL on HyperLink Click using jQuery in ASP.Net

Last Reply one month ago By pandeyism

Posted one month ago

how to open multiple website url using hyperlink in asp.net

You are viewing reply posted by: pandeyism one month ago.
Posted one month ago

Hi GaneshG,

Refer below sample.

HTML

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
    $(function () {
        $("#hfPasslnk").click(function () {
            var urls = $(this).attr('href');
            for (var i = 0; i < urls.split(';').length; i++) {
                window.open(urls.split(';')[i], '_blank');
            }
            return false;
        });
    });
</script>
<asp:HyperLink ID="hfPasslnk" NavigateUrl="http://www.aspforums.net/;https://www.aspsnippets.com/"
    runat="server" Text="Click here"></asp:HyperLink>

Screenshot