在1.asp 里面有一个按钮<input type="button" value="上传" onclick="window.open("2.asp","","")">还有一个文本框nr
在2.asp里面 最后有一个判断
var flag=0;//上传成功标记
if(flag=1){
   alert("上传成功!");
   self.open.document.all.nr.value="文件名"
}

解决方案 »

  1.   

    self.open.document.all.nr.value
    open 是什么意思?all哪? 我的1.asp页面上的form名称是form1.1.asp页面在位于框架页面的mainframe里。
    怎么样写?能详细一点吗?
      

  2.   

    self.open.document.all.nr.value
    open 是什么意思?all哪? 我的1.asp页面上的form名称是form1.1.asp页面在位于框架页面的mainframe里。
    怎么样写?能详细一点吗?
      

  3.   

    hoho  open是笔误 不好意思 应该是opener   不管你的1.asp是在什么页  只要是用open方法打开的2.asp页面(如上面写的)就可以用我这种方法更新1.asp了!
      

  4.   

    但是如果不用open打开既  2.asp页面也是在框架里面打开的 (不是新的窗口)就要改成
    var flag=0;//上传成功标记
    if(flag=1){
       alert("上传成功!");
       self.top.frames['mainframe'].document.all.nr.value="文件名"
    }
      

  5.   

    1.asp:
    ------------------------------------------
    <form name="productform" method="post" action="2.asp" target="BackFrame" enctype="multipart/form-data">
    <input type=text name=filename>
    .......
    </form>
    <iframe name="BackFrame" width="0" height="0" src="about:blank"></iframe>
    2.asp:
    ------------------------------------------
    <%
    '上传文件,在此省略
    ....
    ....
    ....'返回文件名strFileName
    response.write "<script>window.parent.document.productform.filename.value='" & strFileName & "';</script>"%>
      

  6.   

    不行。没有把得到的文件名传递给1.asp页面上的文本框里!
    这是关联代码。帮忙看一下!
    if right(PhotoPath,1)<>"/" then PhotoPath=PhotoPath&"/" 
    datetime=year(date)&month(date)&day(date)&hour(now)&minute(now)&second(now)
    session("filename")=datetime&fileext
    file.SaveAs Server.mappath(PhotoPath&session("filename"))
    response.write "<script>self.parent.document.form1.nr.value='dfsdf'</script>"
    response.write "<script>javascript:window.opener=null;window.close();</script>"
      

  7.   

    self  . opener .  document .  all  .  nr .  value
    当前页    父亲页    对象     所有元素
      

  8.   

    是这样的。上传连接到的是新窗口。在新窗口中实现了上传功能。然后返回得到的文件名插入到上上一个也面的form1中的nr文本框中的当前光标。
      

  9.   

    self.opener.document.form1.nr.value='dfsdf'
      

  10.   

    一个上。也就是1.asp里
    在1.asp里有个按钮。点击弹开新窗口2.asp。处理上传程序。返回文件名传递到1.asp里的form1.nr.value里
      

  11.   

    就用self.opener.document.form1.nr.value='dfsdf'(在2.asp里面写)就可以了
      

  12.   

    无奈!格式怎么写!
    放到这里面。怎么写
    response.write "<script>self.opener.document.form1.nr.value='dfsdf'</script>"是这样吗?好象没有反映!
      

  13.   

    response.write "<script>alert('执行否');self.opener.document.form1.nr.value='dfsdf'</script>"看看有没有执行