我有一个像
Response.Redirect("~/webpages/frmCrystalReportViewer.aspx?VoucherNo=" + txtVoucherNo.Text + "&VoucherDate=" + txtVoucherDate.Text + " &strUserCode=" + strUserCode.ToString() + "&strCompanyCode=" + strCompanyCode.ToString() + "&formName=frmPaymentVoucher");
我想在浏览器的新标签页中打开这个 url。我试过下面的代码......
string pageurl = "~/webpages/frmCrystalReportViewer.aspx?VoucherNo=" + txtVoucherNo.Text + "&VoucherDate=" + txtVoucherDate.Text + " &strUserCode=" + strUserCode.ToString() + "&strCompanyCode=" + strCompanyCode.ToString() + "&formName=frmPaymentVoucher";
Response.Write("<script>");
Response.Write("window.open('" + pageurl + "','_blank')");
Response.Write("</script>");
我也试过下面
string pageurl = "~/webpages/frmCrystalReportViewer.aspx?VoucherNo=" + txtVoucherNo.Text + "&VoucherDate=" + txtVoucherDate.Text + " &strUserCode=" + strUserCode.ToString() + "&strCompanyCode=" + strCompanyCode.ToString() + "&formName=frmPaymentVoucher";
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "popup", "window.open('" + pageurl + "','_blank')", true);
我也试过
<asp:Button ID="btnPrint" Text="Print" runat="server" OnClick="btnPrint_Click" OnClientClick="aspnetForm.target ='_blank';"/>
但都没有工作。请告诉我任何其他解决方案。提前致谢。