T
Tim.Forbess
During a postback event from the treeview control I try to update a
label's text. The code is called in the event handler for
OnTreeNodePopulate but the label text isn't updated when the page
returns. Below is the sample code. Ideas?
--------------------------------
<%@ Page Language="C#" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
}
public void OnPopulate(Object sender, TreeNodeEventArgs e)
{
MessageLabel.Text = "populating";
}
</script>
<html>
<head runat="server"><title>Test</title></head>
<body>
<form id="form1" runat="server"><div>
<asp:TreeView ID="TreeControl" runat="server"
OnTreeNodePopulate="OnPopulate">
<Nodes>
<asp:TreeNode Text="Root" Expanded="False"
PopulateOnDemand="true"></asp:TreeNode>
</Nodes>
</asp:TreeView>
<asp:Label ID="MessageLabel" runat="server"
Text=""></asp:Label>
</div></form>
</body>
</html>
label's text. The code is called in the event handler for
OnTreeNodePopulate but the label text isn't updated when the page
returns. Below is the sample code. Ideas?
--------------------------------
<%@ Page Language="C#" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
}
public void OnPopulate(Object sender, TreeNodeEventArgs e)
{
MessageLabel.Text = "populating";
}
</script>
<html>
<head runat="server"><title>Test</title></head>
<body>
<form id="form1" runat="server"><div>
<asp:TreeView ID="TreeControl" runat="server"
OnTreeNodePopulate="OnPopulate">
<Nodes>
<asp:TreeNode Text="Root" Expanded="False"
PopulateOnDemand="true"></asp:TreeNode>
</Nodes>
</asp:TreeView>
<asp:Label ID="MessageLabel" runat="server"
Text=""></asp:Label>
</div></form>
</body>
</html>