vb.net - Why does ASP.NET TreeView node expanding not work on postbacks? -
i populating asp.net (vb) treeview data database. while populating tree, programmatically expand specific nodes based on data. node expansion completed correctly when called non-postbacks not postbacks after button click. thinking page lifecycle resetting formatting somehow on button postbacks. know how can populate treeview nodes formatting intact button postbacks?
protected sub page_load(byval sender object, byval e system.eventargs) handles me.load 'formatting intact if not page.ispostback loadtreeview("mytree") end if 'formatting not intact if page.ispostback loadtreeview("mytree") end if end sub 'formatting not intact public sub btnloadhierarchy_click(byval sender object, byval e system.eventargs) handles btnloadhierarchy.click loadtreeview("mytree") end sub <asp:button id="btnloadhierarchy" runat="server" text="load hierarchy"/> <asp:treeview id="hierarchytree" runat="server"> </asp:treeview>
Comments
Post a Comment