关闭当前页面时,刷新当前页面的“父页面”
#region RefreshFatherPage
//刷新Father页面
public static void RefreshFatherPage(HttpResponse Response ,bool isCloseCurPage)
{
StringBuilder scriptString = new StringBuilder();
scriptString.Append("<script language = javascript>");
scriptString.Append("window.opener.refresh();");
if (isCloseCurPage )
{
scriptString.Append( " window.focus();" );
scriptString.Append( " window.opener=null;" );
scriptString.Append( " window.close(); " );
}
scriptString.Append("</"+"script>");
Response.Write(scriptString.ToString());
}
/*
需要在Father页面的html中添加如下脚本(在Header中):
<script language="javascript">
function refresh()
{
this.location = this.location;
}
</script>
*/
#endregion
//刷新Father页面
public static void RefreshFatherPage(HttpResponse Response ,bool isCloseCurPage)
{
StringBuilder scriptString = new StringBuilder();
scriptString.Append("<script language = javascript>");
scriptString.Append("window.opener.refresh();");
if (isCloseCurPage )
{
scriptString.Append( " window.focus();" );
scriptString.Append( " window.opener=null;" );
scriptString.Append( " window.close(); " );
}
scriptString.Append("</"+"script>");
Response.Write(scriptString.ToString());
}
/*
需要在Father页面的html中添加如下脚本(在Header中):
<script language="javascript">
function refresh()
{
this.location = this.location;
}
</script>
*/
#endregion