没有出现这种情况呀,测试文件
a.html<form name=Form1>
<input name=txtOpinion1>
<input name=txtLeader1>
<input name=txtOpinion2>
<input type=button onclick=go()>
</form>
<script>
function go(){
var ret=new Array(2);
    ret=window.showModalDialog("b.html", null,"dialogHeight: 550px; dialogWidth: 700px;center: Yes;resizable:no;status:no;scroll:no; ");
if(!ret)return;
window.Form1.all.txtOpinion1.value=ret[0];
window.Form1.all.txtLeader1.value=ret[1];
window.Form1.all.txtOpinion2.value=ret[2];
}
</script>b.html
<form name=Form1>
<input name=txtOpinion1>
<input name=txtLeader1>
<input name=txtOpinion2>
<input type=button onclick=go()>
</form>
<script>
function go(){
var ret=new Array(2);
ret[0]=document.all("txtOpinion1").value ;
ret[1]=document.all("txtLeader1").value;
ret[2]=document.all("txtOpinion2").value;
window.returnValue=ret;
window.close();}
</script>

解决方案 »

  1.   

    秋水大侠,我用的都是服务器控件,没有用html控件啊.
      

  2.   

    你可以自己测试一下
    比如在 b返回是看看他们的值是什么,然后找找原因
    b.html
    <form name=Form1>
    <input name=txtOpinion1>
    <input name=txtLeader1>
    <input name=txtOpinion2>
    <input type=button onclick=go()>
    </form>
    <script>
    function go(){
    var ret=new Array(2);
    ret[0]=document.all("txtOpinion1").value ;
    ret[1]=document.all("txtLeader1").value;
    ret[2]=document.all("txtOpinion2").value;
                               alert(ret[0]);
                               alert(ret[1]);
                               alert(ret[2]);
    window.returnValue=ret;
    window.close();}
    </script>
      

  3.   

    各位,都看清楚了,是服务器控件,不是html控件.
      

  4.   

    你自己不是用的javascript脚本吗?我是按照你的写的阿
      

  5.   

    在页面上的所有控件我用都是服务器控件,只是打开b.aspx页中用的html控件,返回的时候,我是写在body onunload="winOnUnload()" 事件里的
    var ret=new Array(2);
    ret[0]=document.all("txtOpinion1").value ;
    ret[1]=document.all("txtLeader1").value;
    ret[2]=document.all("txtOpinion2").value; window.returnValue=ret;
      

  6.   

    我测试了一下,当在b.aspx页中使用html控件(即input type="button")触发赋值代码,则没有问题,我想是不是服务器回发问题??
      

  7.   

    http://www.csdn.net/Develop/read_article.asp?id=15113