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

Last Reply 3 months ago By pandeyism

Posted 3 months ago

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

Posted 3 months ago

Hi GaneshG,

Do you want open multiple website on click to hyperlink ?

Will you explain in details ?


Posted 3 months ago

yes,I want multiple website url pass usinh hyperlink


Posted 3 months 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