关闭当前页面时,刷新当前页面的“父页面”

#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

posted on 2005-08-20 20:23  曙光  阅读(1333)  评论(0编辑  收藏  举报

导航