如何重定向到另一个页面并单击一个按钮打开一个新窗口?
protected void ASPxButton_save_Click(object sender, EventArgs e)
{
try
{
//do other stuff
if (oSoins.DEVENIR_ECVAC_PAR != 0)
{
string AdrUrl = "Print_DosSoin.aspx?SoinId=" + Soin_Id;
ClientScript.RegisterStartupScript(this.GetType(), "newWindow", String.Format("<script>window.open('{0}');</script>", AdrUrl));
}
Response.Redirect("DossierSoin_Liste.aspx");
}
catch (ThreadAbortException) {/* do nothing, it might be a response.Redirect exception */}
catch (Exception excThrown)
{
lbl_err.Text = excThrown.Message;
if (excThrown.InnerException != null) lbl_err.Text += "-->" + excThrown.InnerException.Message;
string TempMsg = "DosSoin Fiche " + Appel_ID + "-- ASPxButton_save_Click -->" + lbl_err.Text;
Outils.SendingEmail(TempMsg);
}
使用上面的脚本,它会重定向但不会打开新窗口。
先感谢您。