Using the Treeview Webcontrol

I

Irishmaninusa

Hello,

I am a newbie to asp.net and I am trying to do sample code using the
treeview code, and for some reason it is not displaying the way I would
expect it to display. HEre is the code in question

<%@ Import Namespace="Microsoft.Web.UI.WebControls" %>
<%@ Register TagPrefix="IE"
Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls" %>



<script runat="server">
sub TreeView_SelectedIndexChanged(s as object, e as TreeViewSelectEventArgs)
lblSelectedNode.text = treeBooks.GetNodeFromIndex(e.NewNode).Text
end sub
</script>

<html>
<head><title>Test</title></head>
<body>
<form runat="Server">
<IE:TreeView
id="treeBooks"
AutoPostBack="True"
OnSelectedIndexChange="TreeView_SelectedIndexChanged"
Runat="Server">
<TreeNode Text="Home" >
<TreeNode
Text="test" />
<TreeNode
Text="test2" />
</TreeNode>
</IE:TreeView>
<asp:label id="lblSelectedNode" Runat="server" />
</form>
</body>
</html>

I was expecting a tree view to display a node of Home and then subnodes test
and test2, but it doesn't do that, it just displays the items on the screen.
Thanks in advance for any help that is given on this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top