TreeView я с горем пополам слепил.
В нижнем уровне дерева я получаю адресс страницы
как мне отобразить ету страницу в правои половине моего же окна ?
Текст на всяк привожу
Спасибо
- Код: Выделить всё
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default5.aspx.vb" Inherits="Default5" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Const connectionString As String = "Data Source=MySQLServer;Initial Catalog=wfSystem;Integrated Security=True"
sub TreeView1_TreeNodePopulate(sender As Object, _
e As TreeNodeEventArgs)
Dim con As New SqlConnection(connectionString)
Dim cmd As SqlCommand
If (e.Node.Value = "IS NULL") Then
cmd = New SqlCommand("SELECT ItemID, ItemParent, ItemDescription, ItemCommand FROM tsMenuTree WHERE (ItemParent " & e.Node.Value & " ) ORDER BY ItemDescription ", con)
Else
cmd = New SqlCommand("SELECT ItemID, ItemParent, ItemDescription, ItemCommand FROM tsMenuTree WHERE (ItemParent = '" + e.Node.Value + "' ) ORDER BY ItemDescription ", con)
End If
con.Open()
Dim dtr As SqlDataReader = cmd.ExecuteReader()
While dtr.Read()
Dim newNode As New TreeNode()
newNode.Text = dtr("ItemDescription").ToString()
newNode.Value = dtr("ItemID").ToString()
'=?===================================
'dtr("ItemCOMMAND").ToString() Содержит строку типа http://www.microsoft.com
'=====================================
e.Node.ChildNodes.Add(newNode)
'cmd2.ExecuteNonQuery()
If IsDBNull(dtr("ItemCommand")) Then
newNode.PopulateOnDemand = True
Else
newNode.PopulateOnDemand = False
End If
End While
dtr.Close()
con.Close()
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TreeView ID="TreeView1" runat="server"
ExpandDepth="1"
OnTreeNodePopulate="TreeView1_TreeNodePopulate"
ImageSet="XPFileExplorer" NodeIndent="15">
<ParentNodeStyle Font-Bold="False" />
<HoverNodeStyle Font-Underline="True" ForeColor="#6666AA" />
<SelectedNodeStyle BackColor="#B5B5B5" Font-Underline="False" HorizontalPadding="0px"
VerticalPadding="0px" />
<NodeStyle Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black" HorizontalPadding="2px"
NodeSpacing="0px" VerticalPadding="2px" />
<Nodes>
<asp:TreeNode
Text="Arbeitsplatz"
PopulateOnDemand="True" Value="IS NULL" />
</Nodes>
</asp:TreeView>
</div>
</form>
</body>
</html>