Wednesday, March 28, 2012

TreeView efficiency

I have a TreeView in an update panel. The Treeview is populated from an XmlDataSource.

I have another panel (ContentPanel) which is updated by this tree.

So, the only reason I have the TreeView in an update panel is so that the ContentPanel can be updated on a TreeNode click.

This works fine - everytime i click on a node of the TreeView, the ContentPanel is updated as expected.

However, when I checked the HttpHeaders and the Body sent by the cleint and the webserver, I noticed that when I click on a TreeView node, the response to the request contains the HTML for the entire tree again!

Why does the TreeHtml need to updated in this way???

Its incredibly inefficient (89k)!!!!

Am I doing something wrong?

Same problem for me...

However I think we not doing anything wrong.

If we click/select a node, it is actually a postback from the updatepanel, therefore the updatepanel refresh itself (sending the treeview again and again)

You can set

EnableClientScript="true"

for the treeview, but it only helps expanding and collapsing the nodes without a postback in my knowledge.

It would be nice a new ajax enabled treeview in the atlas control toolkit.

No comments:

Post a Comment