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">
        <asp:TreeView ID="TreeView1" runat="server"
                OnSelectedNodeChanged="TreeView1_SelectedNodeChanged" >
            <asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="ExpandNode" />

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?
Who is Participating?
For the update panel, set ChildrenAsTriggers = True.  With that then every control in the update panel will cause the asynch postback without explicity setting it in the Triggers node.  The control's event will need to cause a postback of course for this to work.  If ExpandNode doesn't cause a postback normally then it won't cause the UpdatePanel to fire either.
Tommie Nathaniel Carter, Jr., MBAFounderCommented:
If the control has sub controls. The subs have events bound to them then I expect this would work.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.