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="TreeVi ew1_Expand Node"
OnSelectedNodeChanged="Tre eView1_Sel ectedNodeC hanged" >
</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?
<asp:UpdatePanel ID="TreeUpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:TreeView ID="TreeView1" runat="server"
ExpandDepth="1"
ShowLines="true"
ShowExpandCollapse="true"
OnTreeNodePopulate="TreeVi
OnSelectedNodeChanged="Tre
</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?
If the control has sub controls. The subs have events bound to them then I expect this would work.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.