Link to home
Start Free TrialLog in
Avatar of bemara57
bemara57

asked on

Can a control trigger itself for AJAX.NET?

I have a TreeView control in AJAX.NET 2.0 / C#. What I'm trying to do is set a trigger on an UpdatePanel that comes from itself. Is this possible? Here's what I'm trying to do but gives a compile error saying it can't find the event name:

        <asp:UpdatePanel ID="TreeUpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
        <asp:TreeView ID="TreeView1" runat="server"
                ExpandDepth="1"
                ShowLines="true"
                ShowExpandCollapse="true"
                OnTreeNodePopulate="TreeView1_ExpandNode"
                OnSelectedNodeChanged="TreeView1_SelectedNodeChanged" >
        </asp:TreeView>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="ExpandNode" />
        </Triggers>
        </asp:UpdatePanel>

The error I get is this:
Could not find an event named 'ExpandNode' on associated control 'TreeView1' for the trigger in UpdatePanel 'TreeUpdatePanel1'.

Can I trigger a control with an event from itself?
Avatar of Tommie Nathaniel Carter, Jr., MBA
Tommie Nathaniel Carter, Jr., MBA
Flag of United States of America image

If the control has sub controls. The subs have events bound to them then I expect this would work.
ASKER CERTIFIED SOLUTION
Avatar of TheNige
TheNige

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial