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

前端 未结 16 2178
情书的邮戳
情书的邮戳 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:58

    Just had the same problem. Client-side wasn't appropriate because the button was posting back information from a listview.

    Saw same solution as Amaranth's on way2coding but this didn't work for me.

    However, in the comments, someone posted a similar solution that does work

    OnClientClick="document.getElementById('form1').target ='_blank';"
    

    where form1 is the id of your asp.net form.

提交回复
热议问题