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);
}
}
參考資訊:
http://stackoverflow.com/questions/19027959/how-to-refresh-parent-page-after-closing-popup-window-in-javascript