Treeview event

Discussion in 'ASP .Net' started by Tim.Forbess@gmail.com, Sep 17, 2006.

  1. Guest

    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>
     
    , Sep 17, 2006
    #1
    1. Advertising

  2. Guest

    The answer seems to be that this treeview event is an "out of band"
    request. An out of band request obtains additional data, without
    posting the entire page. Therefore only the treeview is updated.

    This is fine, but it would have been nice to know in the documentation
    for the event!
     
    , Sep 18, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VHltYm93?=
    Replies:
    2
    Views:
    24,670
    =?Utf-8?B?VHltYm93?=
    Jan 10, 2006
  2. abargaddon
    Replies:
    0
    Views:
    1,104
    abargaddon
    Jan 17, 2008
  3. Per Salmi

    TreeView not rendering nodes? Cacheing of a TreeView

    Per Salmi, Oct 15, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    520
    Steve Drake
    Oct 15, 2003
  4. Ionutz
    Replies:
    2
    Views:
    571
    Ionutz
    Oct 23, 2005
  5. stepkurt

    Microsoft Treeview vs System Treeview

    stepkurt, Aug 29, 2007, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    420
    Teemu Keiski
    Sep 2, 2007
Loading...

Share This Page