asp.net中Treeview控件的更新面板不起作用?

时间:2022-11-06 18:58:33

On clicking the nodes in Treeview, i construct the HTML in code behind and load it in my literal control. I do not want the page to load each time I click any of the nodes in tree view control to fetch the data for showing it in literal. How can I avoid postback here ? I tried using updatepanel around treeview as shown below, and now the data is not changing on clicking different nodes and there is not postback. How can i solve this ?

在Treeview中单击节点时,我在后面的代码中构建HTML并将其加载到文本控件中。我不希望在每次单击树视图控件中的任何节点时加载该页面,以获取以文字形式显示它的数据。我怎么能避免回邮?我尝试在treeview上使用updatepanel,如下所示,现在数据在单击不同的节点时没有变化,并且没有回发。我怎么解决这个问题呢?

                            <table> 
                                <tr>
                                    <td valign="top">
                                        <asp:UpdatePanel ID="UP_HealthCon_Ddl_Conditions" runat="server">
                                            <contenttemplate>
                                      <asp:TreeView ID="Tree_Index" NodeWrap="false" Style="font-size: 11px; font-family: Tahoma; font-weight: bold; text-align: left;" runat="server" Width="10px" EnableClientScript="False">
                                        </asp:TreeView>
                                         </contenttemplate> 
                                         </asp:UpdatePanel>
                                    </td>
                                </tr>
                            </table>


                            <table>
                                <tbody>
                                    <asp:Label ID="litSPName" runat="server" Font-Bold="true"></asp:Label>
                                    <br />
                                    <br />
                                    <asp:Literal ID="lit_basic_Result" runat="server"></asp:Literal>
                                </tbody>
                            </table>

1 个解决方案

#1


0  

Added the contenttemplate and updatepanel to my tables and it worked !!!

将contenttemplate和updatepanel添加到我的表中,它成功了!!!

#1


0  

Added the contenttemplate and updatepanel to my tables and it worked !!!

将contenttemplate和updatepanel添加到我的表中,它成功了!!!