J
jm
<%@ Page Language="c#" autoeventwireup="false" %>
<%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls" %>
<script runat="server">
void Page_load(object sender, EventArgs e) {
// Create the first TreeNode
TreeNode tvFirst = new TreeNode();
tvFirst.Text = "First Tree Node";
// Create the second TreeNode
TreeNode tvSecond = new TreeNode();
tvSecond.Text = "Second Tree Node";
// Add the second TreeNode as a child of the first
tvFirst.Nodes.Add(tvSecond);
// Add the first TreeNode to the TreeView's root TreeNodes
TreeView1.Nodes.Add(tvFirst);
}
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<iewc:TreeView id="TreeView1" runat="server">
<iewc:TreeNodeType></iewc:TreeNodeType>
</iewc:TreeView>
</p>
</form>
</body>
</html>
The page loads with no errors. I simply get nothing on the page
displayed. Is there some method I have to do so that I can see the
nodes I have added? I know treeview works on my system as I can hard
code nodes. Thank you.
<%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls" %>
<script runat="server">
void Page_load(object sender, EventArgs e) {
// Create the first TreeNode
TreeNode tvFirst = new TreeNode();
tvFirst.Text = "First Tree Node";
// Create the second TreeNode
TreeNode tvSecond = new TreeNode();
tvSecond.Text = "Second Tree Node";
// Add the second TreeNode as a child of the first
tvFirst.Nodes.Add(tvSecond);
// Add the first TreeNode to the TreeView's root TreeNodes
TreeView1.Nodes.Add(tvFirst);
}
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<iewc:TreeView id="TreeView1" runat="server">
<iewc:TreeNodeType></iewc:TreeNodeType>
</iewc:TreeView>
</p>
</form>
</body>
</html>
The page loads with no errors. I simply get nothing on the page
displayed. Is there some method I have to do so that I can see the
nodes I have added? I know treeview works on my system as I can hard
code nodes. Thank you.