how to open a page in new tab on button click in asp.net?

前端 未结 16 2176
情书的邮戳
情书的邮戳 2020-11-29 07:32

I want to open a page in new tab of browser on button click.

I have searched a lot on google but i couldn\'t find anything.

Here is my button.



        
16条回答
  •  青春惊慌失措
    2020-11-29 07:50

    You shuld do it by client side. you can place a html hyperlink with target="_blank" and style="display:none". after that create a javascript function like following

    function openwindow(){
    $("#hyperlinkid").click();
    return false;
    }
    

    use this function as onclientclick event handler of the button like onclientclick="return openwindow()" You need to include a jquery in the page.

提交回复
热议问题