{ 14 StrScript.Append(string.Format("width={0};" ,width)+"\n"); 15 StrScript.Append(string.Format("height={0};" ,high)+"\n"); 16 } 17 18 StrScript.Append( "window.open(''''"+ pageUrl +"'''',''''_blank'''',''''toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,top=0,left=0,height=''''+ height +'''',width=''''+ width +'''''''');" ); 19 if ( isCloseOldPage ) 20 { 21 StrScript.Append( " window.focus();" ); 22 StrScript.Append( " window.opener=null;" ); 23 StrScript.Append( " window.close(); " ); 24 } 25 StrScript.Append( "</script>" ); 26 if ( ! page.IsStartupScriptRegistered( scriptName ) ) 27 { 28 page.RegisterStartupScript( scriptName, StrScript.ToString() ); 29 } 30 } 31 #endregion 3.还有一种情况就是我们需要在关闭当前页面时,刷新当前页面的“父页面”,所谓“父页面”,就是Post本页面之前的一个页面。可以调用如下API:
 RefreshFatherPage#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 )
 {
&nb上一页 [1] [2] [3] 下一页 |