打印本文 打印本文 关闭窗口 关闭窗口
Asp.net实用技巧(2)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数4028  更新时间:2009/4/23 10:40:34  文章录入:mintao  责任编辑:mintao
nbsp;         this.location = this.location;
        }
        </script>
         */        
        #endregion

2.如何刷新祖先页面中的某个frame中的page了?

RefreshFrameInAncestorPage#region RefreshFrameInAncestorPage
        /**//// <summary>
        /// 刷新指定的祖先页面中的某个框架的内部页面
        /// </summary>        
        public static void RefreshFrameInAncestorPage(HttpResponse Response ,string ancestorTitle ,string frameName ,string targetUrl ,bool isCloseCurPage)//targetPageTitle 目标页面的title
        {            
            StringBuilder scriptString = new StringBuilder();
            scriptString.Append("<script language = javascript>");
            scriptString.Append("var p = window ;");
            scriptString.Append(string.Format("while(p.document.title != ''''{0}'''')" ,ancestorTitle));
            scriptString.Append("{");            
            scriptString.Append("p = p.opener ;");
            scriptString.Append("}");            
            scriptString.Append("p.focus();");
            scriptString.Append(string.Format("p.{0}.location = ''''{1}'''';" ,frameName, targetUrl));

            if (isCloseCurPage )
            {
                scriptString.Append( " window.focus();" );
                scriptString.Append( " window.opener=null;" );
                scriptString.Append( " window.close(); " );
            }            

            scriptString.Append("</"+"script>");

            Response.Write(scriptString.ToString());
        }        
        #endregion

3.如何刷新本页面中的其它框架了?

上一页  [1] [2] [3] [4] [5] [6]  下一页

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