不太明白你的问题,既然A和B是两个窗口打开的两个页面,从B返回A是怎么回事呢?跳出一新的页面C是跳转到了页面C还是页面C在新的窗口中打开了?另外你说的返回是指点击浏览器的后退按钮返回到历史记录的上一页吗?

解决方案 »

  1.   

    A是父窗口,B是子窗口,当点了A中的按钮就跳出B页面,我的B页面是一个DATAGRID,里面有‘选择’模板列,当点了某行的‘选择’按钮后就把这行的数据返回到A页面中。原来我在B页面中没写搜索程序的时候是可以返回值的,现在写了后就不能返回值了(是在我搜索后)。
      

  2.   

    在HTML中:
    <script>
    function retValue(n,a1,a2,a3,a4,a5,a6,a7)
    {
    opener.document.getElementById("fyarnbno"+n).value=a1;
    opener.document.getElementById("fyarnname"+n).value=a2;
    opener.document.getElementById("fyarnbrand"+n).value=a3;
    opener.document.getElementById("fvatno"+n).value=a4;
    opener.document.getElementById("fcolorname"+n).value=a5;
    opener.document.getElementById("fcolorcode"+n).value=a6;
    opener.document.getElementById("fcutno"+n).value=a7;
    self.close();
    }
    </script>
    =====================================
    在后台代码中:
    Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As DataGridItemEventArgs) 'Handles Datagrid1.ItemDataBound
            If e.Item.ItemIndex >= 0 Then
                e.Item.Attributes("onmouseover") = "this.name=this.style.backgroundColor;this.style.backgroundColor='#dcdcdc';this.style.cursor='hand'"
                e.Item.Attributes("onmouseout") = "this.style.backgroundColor=this.name;"            If Not Request.QueryString("select") = Nothing Then
                    Dim n As String = Request.QueryString("select").ToString()
                    Dim a1 As String = CType(e.Item.FindControl("Label1"), Label).Text
                    Dim a2 As String = CType(e.Item.FindControl("Label2"), Label).Text
                    Dim a3 As String = CType(e.Item.FindControl("Label3"), Label).Text
                    Dim a4 As String = CType(e.Item.FindControl("Label4"), Label).Text
                    Dim a5 As String = CType(e.Item.FindControl("Label5"), Label).Text
                    Dim a6 As String = CType(e.Item.FindControl("Label6"), Label).Text
                    Dim a7 As String = CType(e.Item.FindControl("Label8"), Label).Text
                    CType(e.Item.Cells(14).Controls(0), LinkButton).Attributes("onclick") = "return retValue(""" & n & """,""" & a1 & """,""" & a2 & """,""" & a3 & """,""" & a4 & """,""" & a5 & """,""" & a6 & """,""" & a7 & """)"
                    'e.Item.Attributes("onclick") = "return retValue(""" & n & """,""" & a1 & """,""" & a2 & """,""" & a3 & """,""" & a4 & """,""" & a5 & """,""" & a6 & """)"
                End If
            End If
        End Sub
      

  3.   

    可能页面已经刷新了,OPENER找不到了
      

  4.   

    可能页面已经刷新了,OPENER找不到了
      

  5.   

    不会的,只要这个页面没有在新窗口中打开,那么它的opener仍是原来打开它的父窗口。