在parent.aspx页面里点击按钮弹出一个窗口填写信息,填写完了之后,点击提交,我想让弹出的窗口关闭并返回parent.aspx页面,要怎么实现的?

解决方案 »

  1.   

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        
    default.aspx:</head>
    <body>
        <form id="form1" runat="server">
        <div>
         <input type="button" value="Open new window" onClick="javascript:showModalDialog('dialog.aspx');">
        </div>
        </form>
    </body>
    </html>dialog.aspx:
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
     </head>
    <body>
        <form id="form1" runat="server">
        <div >
       
         <input type="button" value="close me" onClick="javascript:window.close();">
        </div>
        </form>
    </body>
    </html>
      

  2.   

    window.open
    window.showmodaldialog
    window.close();关闭
      

  3.   

    直接按钮调用window.close()不就可以了?
      

  4.   

    我那个用窗口打开的文件是.ashx文件。。不知道有没有影响
      

  5.   

    那估计就是这里的问题了
    一般情况下是不会有这个问题的
    window.close()就可以关闭
    建议楼主做个小实验
    问题不再你不能关闭
    而是其他地方导致你这里不能关闭
      

  6.   

    子页面的header里面加上这句
    <base target="_self">
      

  7.   

    js中写下面的函数弹出窗口:
    window.open(“URL”,"","");
    window.showmodaldialog(“URL”,"","");//模式对话框
    关闭窗口
    window.close();
      

  8.   

    window.close(),这个都关闭不了?楼主你代码里边有什么错误吧?
    检查下,看看这个东东执行到了吗?不应该关不了呀!
      

  9.   

    可以了呵
    我让window.parent.location = window.parent.location 就返回咯。。