Close 畫面 並將父畫面Reload
Script:
window.opener.location.reload();
window.close();
C# 編寫JavaScript 語法
//直接關閉視窗
public void Close()
{
Page p = (Page)System.Web.HttpContext.Current.Handler;
ClientScriptManager CSM = p.ClientScript;
String ScriptName = "close";
String ScriptMsg = "window.opener.location.reload();window.close();";
Type CsType = p.GetType();
if (!CSM.IsStartupScriptRegistered(CsType, ScriptName))
{
CSM.RegisterStartupScript(CsType, ScriptName, ScriptMsg, true);
}
}
沒有留言:
張貼留言