Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
105
Bind html table onNodeClick by AJAX
posted

Hi,

Right now I have a webtree that when the user press on some node, it displays a html table (text inside) with some details about the selected node. This is working but each node click is a post back. Now I'm trying to improve this and try to make it Ajax Calls.

My first thought was that just adding a WARP panel containing the table would be enough. But I don't get the results that I was looking for. Still post backs are happening. 

So my questions are:

What properties should I add/change to the webtree in order to make AJAX calls and not fully postbacks? 

In the Warp I just set TriggerControlIDs="MyUltraWebTreeID", but Do I need to set up another propety?  

Thanks in advance,

Ulises 

Parents
No Data
Reply
  • 28464
    posted

    I believe the easiest way to proceed would be using asp:UpdatePanel and the built-in Triggers functionality. I have just tried the following code and everything was working as expected. 

        <asp:ScriptManager runat="server" ID="ScriptManager1"></asp:ScriptManager>   


        <ignav:UltraWebTree ID="UltraWebTree1" runat="server"
            onnodeclicked="UltraWebTree1_NodeClicked">
            <Levels>
                <ignav:Level Index="0" />
            </Levels>
            <Nodes>
                <ignav:Node Text="Root Node">
                    <Nodes>
                        <ignav:Node Text="Child Node">
                        </ignav:Node>
                        <ignav:Node Text="Child Node">
                        </ignav:Node>
                        <ignav:Node Text="Child Node">
                        </ignav:Node>
                    </Nodes>
                </ignav:Node>          
            </Nodes>
        </ignav:UltraWebTree>
       
        <br /><br />
       
        <asp:UpdatePanel runat="server" ID="UpdatePanel1">
            <ContentTemplate>
                <asp:Label ID="Label1" runat="server" Text="Default Value"></asp:Label>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="UltraWebTree1" EventName="NodeClicked" />
            </Triggers>
        </asp:UpdatePanel>
     

    Hope this helps. 

Children