我现在能显示出来了,刚才显示不出来原因是未自动加载。
我的框架如下: <frameset framespacing="0" border="false" rows="327,38%" frameborder="0">
<frame name="top" id="top" scrolling="auto" src="tree.aspx">
<frame name="main" id="main" scrolling="auto" src="button.aspx">
</frameset>
现在的问题是,在main中如何点击确定按钮,将top中的树节点值传回母页面。
原先的树和确定按钮写在一个页面中,代码是这样写的:
Private Sub btnresume_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnresume.Click
Dim num As Integer '计算选择了多少个。
Dim Accountname As String
Dim Accountid As String
num = 0
'验证是否只选中了一个,并得到该节点值
For m As Integer = 0 To Me.Treeallaccount.Nodes.Count - 1
If Me.Treeallaccount.Nodes(m).Nodes.Count > 0 Then
For n As Integer = 0 To Me.Treeallaccount.Nodes(m).Nodes.Count - 1
If Me.Treeallaccount.Nodes(m).Nodes(n).Checked = True Then
num = num + 1
Accountname = Me.Treeallaccount.Nodes(m).Nodes(n).Text
Accountid = Me.Treeallaccount.Nodes(m).Nodes(n).Target
End If
Next
End If
Next
If num <> 1 Then
Response.Write("<script>alert('请选择一个预算科目!')</script>")
Else
Response.Write("<script>window.opener.document.all.txtallaccount.value='" & Accountname & "'</script>")
Response.Write("<script>window.opener.document.all.txtallaccountid.value='" & Accountid & "'</script>")
Response.Write("<script>window.opener.document.all.chkIsall.checked='True'</script>")
Response.Write("<script>window.close()</script>")
End If
End Sub