Problem with treeview control's postback
-
Hi All, I'm facing a problem with the page postback. Its like....I have a treeview control whose first three levels are populating on page load. The next levels are being populated on “treeview_treenodeexpanded” event ,based on certain criteria .But each time we expand it the page gets posted back, as it is the case. I want the postback to be blocked somehow and the tree nodes need to be populated on expand event only. Is AJAX a solution for this? If so, how to implement this?:confused: I hope someone can help me out with this. Thanks in advance. Regards, Jeeva
-
Hi All, I'm facing a problem with the page postback. Its like....I have a treeview control whose first three levels are populating on page load. The next levels are being populated on “treeview_treenodeexpanded” event ,based on certain criteria .But each time we expand it the page gets posted back, as it is the case. I want the postback to be blocked somehow and the tree nodes need to be populated on expand event only. Is AJAX a solution for this? If so, how to implement this?:confused: I hope someone can help me out with this. Thanks in advance. Regards, Jeeva
The “treeview_treenodeexpanded” event is server-side so therefor a postback is required for this event to fire. The treeview has a built in Ajax-style feature that populates child nodes without a postback. To use it you have to set the
PopulateOnDemand
property of nodes to true. However this will only work with theTreeNodePopulate
event, notTreeNodeExpanded
. You would have to change the populating code to use that event instead. -
The “treeview_treenodeexpanded” event is server-side so therefor a postback is required for this event to fire. The treeview has a built in Ajax-style feature that populates child nodes without a postback. To use it you have to set the
PopulateOnDemand
property of nodes to true. However this will only work with theTreeNodePopulate
event, notTreeNodeExpanded
. You would have to change the populating code to use that event instead.I 'll work with this. Thanks a lot. Regards, Jeeva:)