2011年3月27日 星期日

[轉]Asp.Net C# 加上 JavaScrip 開新視窗,列印

開新視窗,關閉工具列
ScriptManager.RegisterStartupScript(this, this.GetType(), "ALERT", "window.open('ABC.aspx','1234','top=100,left=100,width=720,height=740,toolbar=no');", true);

列印按鈕
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);

[轉]http://king971119.blogspot.com/2009/06/aspnet-c-javascrip.html

沒有留言:

張貼留言