updatePanel中treeview中节点过多,定位滚动条的问题

自己网上找了半天,试了很多方法,都不可以,索信重新把UpdatePanel控件给认识了一边,这才发现,网上的回答都不全,现在我整理了一份。希望对以后碰到类似问题的童鞋有帮助。

这是第一个UpdatePanel

<asp:UpdatePanel ID="Uptv" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
                                <ContentTemplate>
                                    <asp:Panel ID="Paneltv" runat="server" Height="600px" ScrollBars="Auto" Width="450px">
                                        <asp:TreeView ID="tvfun" runat="server" BorderStyle="None" ExpandDepth="0"
                                            ShowLines="True" Width="400px" ForeColor="Black" ShowCheckBoxes="All" OnSelectedNodeChanged="tvfun_SelectedNodeChanged"  >
                                            <SelectedNodeStyle BackColor="#3399FF" />
                                        </asp:TreeView>
                                    </asp:Panel>
                                </ContentTemplate>
</asp:UpdatePanel>

 

这是第二个UpdatePanel

<asp:UpdatePanel ID="Upgv" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <asp:Label ID="LabBtn" runat="server" Text=""></asp:Label>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="tvfun" EventName="SelectedNodeChanged" />
                                </Triggers>
                            </asp:UpdatePanel>

 

注意的是网上很多回答都没有ChildrenAsTriggers="false" 这段代码,导致无法定位滚动条!

posted @ 2014-04-25 17:29  错觉_军  阅读(267)  评论(0编辑  收藏  举报