c# - Open new tab on button click? -


i want open new tab on button click, button clicked exist on iframe.

i use code--

string tempabc = "javascript:window.open('reportviewer.aspx?reporttype=" + rptnew + "&billno=" + billno + "&mail=" + "mail" + "&ccmail=" + ccmail + "&subject=" + txtsubject.text + "&mailbody=" + txtmailbody.text + "')"; clientscript.registerstartupscript(this.gettype(), "script", tempabc, true); 

but should't show result.

then can use code-

response.redirect("reportviewer.aspx?reporttype=" + rptnew + "&billno=" + billno + "&mail=" + "mail" + "&ccmail=" + ccmail + "&subject=" + txtsubject.text + "&mailbody=" + txtmailbody.text + "'"); 

it open next page on same iframe.

what can do.

in .aspx page can use tags.

<body>     <form id="form1" runat="server">     <div>         <asp:toolkitscriptmanager id="toolkitscriptmanager1" runat="server">         </asp:toolkitscriptmanager>         <asp:panel id="panelmail" runat="server">             <asp:updatepanel id="updatepanel15" runat="server">                 <contenttemplate>                       <table>                                              <tr>                             <td colspan="2" style="padding-top: 14px; padding-bottom: 10px;">                                 <center>                                     <asp:button id="btnmail" style="" text="mail" cssclass="btnn" runat="server" onclick="btnmail_click"                                         onclientclick="return mailsubmit();" />                                 </center>                             </td>                         </tr>                     </table>                 </contenttemplate>                 <triggers>                 <asp:asyncpostbacktrigger controlid="btnmail" eventname="click" />                 </triggers>             </asp:updatepanel>         </asp:panel>     </div>     </form> </body> 

you can

<asp:button id="button1" runat="server" text="button"     onclick="button1_click" onclientclick="document.forms[0].target = '_blank';" /> 

edit

then try :

<script type = "text/javascript">  function settarget() {      document.forms[0].target = "_blank";  } </script>  <asp:button id="button1" runat="server" text="button"     onclick="button1_click" onclientclick = "settarget();" /> 

here can put multiple functions.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -