打印本文 打印本文 关闭窗口 关闭窗口
Asp.net实用技巧(1)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数2485  更新时间:2009/4/23 10:40:27  文章录入:mintao  责任编辑:mintao
            {
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]  下一页

打印本文 打印本文 关闭窗口 关闭窗口