有關彈出視窗的寫法

有關彈出視窗的寫法


Response.Write("<Script language='JavaScript'>alert('警告訊息!');window.location.href='Login.aspx';</Script>");
Response.End();
 
 
//列印按鈕

ScriptManager.RegisterStartupScript(this, this.GetType(), "print", "javascript: window.print();", true);
 
//彈出式訊息視窗

ScriptManager.RegisterStartupScript(this, this.GetType(), "ALERT", "alert('訊息');", true);

//彈出式訊息視窗 + 確認後更換頁面


ScriptManager.RegisterStartupScript(this, this.GetType(), "ALERT", "alert('訊息!');window.location='ABC.aspx?A_Sno=1';", true);

 

//轉跳彈出另一視窗

ScriptManager.RegisterStartupScript(this, this.GetType(), "Open", "showModalDialog('ToWorkAdd.aspx?ToWorkID=" + strToWorkID + "&CUST_NO=" + strCustSNQuery + "','工單處理', 'dialogWidth:900px;dialogHeight:600px;');", true);