如何在模态对话框中进行提交而不新开窗口?
   如果你 的 浏览器是IE5.5+,可以在对话框中使用带name属性的iframe,提交时可以制定target为该iframe的name。对于IE4+,你可以用高度为0的frame来作。例如: test6.htm
<script>
  window.showModalDialog("test7.htm")
 </script> test7.htm
if(window.location.search) alert(window.location.search)
 <frameset rows="0,*">
  <frame src="about:blank">
  <frame src="test8.htm">
 </frameset> test8.htm
<form target="_self" method="get">
 <input name=txt value="test">
 <input type=submit>
 </form>
 <script>
 if(window.location.search) alert(window.location.search)
 </script>

解决方案 »

  1.   

    打开对话框
    test.aspx
    <head>
    <base target="_self">
    </head>
    <body>
    <form runat=server target="ff" name="form2"></form>
    里面有一个
    <asp:textbox>(输入查询值)
    <asp:dropdownlist>(这个里面是查询字段)如客户名称/客户地址
    <asp:button>查询按钮还有一个<table>
    </body>
      

  2.   

    afdfgg(午夜飞行) (::你的方法我试过了,提交弹出新窗口和不执行的情况解决了
    但是我用javascrip返回值时提示"对象不存在"我返回值的脚本是 在table行onclick事件执行下面脚本返回值到主窗口function returnValue(rowObject) (rowObject 是行的ID)
    {
       var result=dialogArguments;  --主窗口传过来的对象
       var rowID=document.getElementId(rowObject.id);
       result.text1.value=rowID.innerText;
       window.close();
    }我看了一下,总出现rowID是NULL值 不知道什么原因?
    }
      

  3.   

    scoutlin(8da子民)(www.8da.cc) :
    你的方法我也用了,不行哦,不会弹出新窗口,但提交时没有执行
      

  4.   

    http://dotnet.aspx.cc/ShowDetail.aspx?id=49ML4AO8-5PB3-4KNY-NJZD-LJOIOXV4M1X4
      

  5.   

    afdfgg(午夜飞行) (:
    你说的方法我也是这么用的
    对话框刚打开时行对象(rowObject)是没问题
    为什么我一执行"提交"把查好的数据放到TABLE后再执行table 行的onclick事件,行的id就是null值
    JAVASCRIPT出错
    我弄了一星期了,有谁来帮我看一下好不好:)
      

  6.   

    document.getElementId,不知道是不是笔误,好像没有这个方法吧,只有getElementById。
    另外,你查询好的结果填充到table,你可以看看生成的html代码,id是不是已经变了?text1是服务端控件还是html控件?