本帖最后由 xiaosong2008 于 2013-08-30 11:32:08 编辑

解决方案 »

  1.   

    试试:
    window.opener.form1.textBox.value= " \/UserFiles\/images\/" + value1;
      

  2.   

    textBox对应图片文本框Id,我怀疑你的id 是.net下的id
      

  3.   


    之前就是这样写的,同样的错误提示!这样写textBox是<input的name
      

  4.   


    之前就是这样写的,同样的错误提示!这样写textBox是<input的name是的,这样写的方法是获取html下的表单元素,而这里的表单元素是.net控件
      

  5.   

    你的textBox是什么?是name字符串的话
    window.opener.form1[textBox].value= " \/UserFiles\/images\/" + value1;是id字符串的话
    window.opener.document.getElementById(textBox).value= " \/UserFiles\/images\/" + value1;是dom元素对象的话
    textBox.value= " \/UserFiles\/images\/" + value1;
      

  6.   

    谢谢各位的帮助,将函数改成如下:
           <script>
             function res(textBox,value1)
             {
                 window.opener.form1[textBox].value= " \/UserFiles\/images\/" + value1;
                 window.close();
             }
             </script>
    调用成功了呵呵,如果我想将asp.net页面的中表单控件也作为参数,该如何写呢?
    将函数改成如下:
           <script>
             function res(form,textBox,value1)
             {
                 window.opener.form[textBox].value= " \/UserFiles\/images\/" + value1;
                 window.close();
             }
             </script>
    或者如下:
           <script>
             function res(form,textBox,value1)
             {
                 window.opener.document.getElementById[form][textBox].value= " \/UserFiles\/images\/" + value1;
                 window.close();
             }
             </script>
    均不行,提示找不到无法获取属性“TextBox1”(参数textBox调用的值)的值: 对象为 null 或未定义请大家继续帮忙看看,呵呵,谢谢了!
      

  7.   

    window.opener.forms[form][textBox].value= " \/UserFiles\/images\/" + value1;
      

  8.   

    谢谢各位的帮助,将函数改成如下:
            <script>
              function res(form,textBox,value1)
              {
                  window.opener.document.forms[form][textBox].value= " \/UserFiles\/images\/" + value1;
                  window.close();
              }
              </script>
    问题解决了