框架关闭不了只有把框架的高或宽设为0比如csdn的隐藏效果就只是把左边的框架宽度设为0的。

解决方案 »

  1.   

    在Main_right..aspx中用 var a =window.showModalDialog("selectperson.aspx");
     if(a==1)
     {
      window.location ="www.csdn.com";
     }
    selectperson.aspx中
    <input type="button" onClick="javascript:window.returnValue=1;window.close()">
      

  2.   

    <input type="button" onClick="javascript:parent.top.main_right.window.location.href='XX.aspx';window.close();">
      

  3.   

    To: cpp2017(幕白兄) 这种方法我试过了,行不通,因为我要selectperson.aspx传递一些参数回来
      

  4.   

    use cpp2017's method, but return an array from selectperson.aspx:var a = [1,2,3,4];
    window.returnValue = a;
    ....
      

  5.   

    你showModalDialog()的时候把main_right.aspx作为参数传递过去了吗?
    应该没有吧,否则你不会用parent.window.location.href了,
    如果你不传递过去,那么你也就不能访问main_right.aspx,更谈不上其他的了
    明白了吗
      

  6.   

    举个例子吧showModalDialog(selectperson.aspx',window,'') //传window对象给子窗口(window不用换,照我的写就可以了)selectperson.aspx中<input type="button" onClick="javascript:window.dialogArguments.location.href='XX.aspx';window.close();">
      

  7.   

    还是不行思归的方法我试过了,取不到值j99616(j99616)的方法也试过了,还是不能实现我发布一下代码
    ------------------------------------main_right框架页面中的一个导航按钮
    添加showModalDialog()的脚本MenuBarLinkItem itemAdd = new MenuBarLinkItem();
    itemAdd.Text="添加";
    itemAdd.Url="javascript:alert(window.showModalDialog('PublishWizard.aspx',window,'Dialogwidth:300px;Dialogheight:200px;status:no;help:no;resizable:no'));";
    SelectPerson.aspx中添加回传数值和关闭的脚本this.Page.RegisterClientScriptBlock("NavrScript","<script language=javascript>window.returnValue='"+Request.ApplicationPath+"/Document/EditDocument.aspx?id="+txtDocument.Text+"';window.dialogArguments.location.reload();window.close();</script>");
      

  8.   

    你先不要传值,先试试其它的(例如:刷新和关闭是否正常),如果正常,你不要用window.returnValue回值,还是用window.dialogArguments.document.all......进行回值,,
    试试先^-^
      

  9.   

    <input type="button" onClick="javascript:window.parent.location.href='XX.aspx';window.close();">
      

  10.   

    window.returnValue='"+Request.ApplicationPath+"/Document/EditDocument.aspx?id="+txtDocument.Text+"';
    你这样回的值对吗?你也可以先测试一下回的值到底是什么...
      

  11.   

    to  j99616(j99616) :值是对的这个没问题先谢谢各位,我用另一种方法解决了