弹出模态窗口关闭并刷新父窗体

框架页面

<div style="text-align: left; margin-left: -10px;">
    <table style="height: 600px; width: 100%">
        <tr>
            <td id="all_3" style="width: 450px; height: 600px;">
                <script type="text/javascript">
                    document.write('<iframe id="left" name="left" src="PostResponsebility.aspx" width="100%" height="100%" scrolling="auto" marginwidth="0" marginheight="0" frameborder="0"></iframe>');
                </script>
            </td>
            <td width="80%" align="center" valign="top" class="all_4" style="height: 100%;">
                <script type="text/javascript">
                    document.write('<iframe id="Right" name="Right" src="" width="100%" height="100%" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>');
                </script>
            </td>
        </tr>
    </table>
</div>

 

打开模态窗口

function AddOrg(DeptID) {
            var height = screen.height - 200;
            var width = screen.width - 350;
            var winoption = "dialogHeight:" + height + "px;dialogWidth:" + width + "px;status:no;scroll:yes;resizable:yes;center:yes";
            var surl = "OrganizationAdd.aspx?DeptID=" + DeptID;
            var returnVal = false;
            returnVal = window.showModalDialog(surl, window, winoption);
     
            if (returnVal == "true") {
                parent.location.href = parent.location.href;           
              
            }     
            parent.location.href = parent.location.href;

        }

 

模态窗口后台代码

     bool flag = actor.AddActor(SysID, RangeID, FullID, ParentID, ActorName, ActorDesc, IconID, ActorClass,DeptID);
           if (flag==true)
           {           

               Response.Write("<script language=javascript>");
               Response.Write("var w;if (window.dialogArguments!=null) w=window.dialogArguments;");
               Response.Write("window.returnValue=1;window.close()");
               Response.Write("</script>");

           }
 

 

你可能感兴趣的:(弹出模态窗口关闭并刷新父窗体)