"AJAX" techniques for the ASPNET 2.0 TreeView control?

K

KJ

Hello All,

Just wondering is it possible to add/edit/remove nodes from a TreeView
via AJAX techniques. I currently have an ASPNET 1.1 app that heavily
uses the IE WebControl TreeView, and I am having to repaint the entire
page as the user is changing the node content. I'd like to avoid this
and am hoping this is possible. In your replies, could you also point
me to some example code for accomplishing this?

Thanks in advance,
-KJ
 
S

Steve C. Orr [MVP, MCSD]

Yes, you can modify the nodes dynamically through code if you wish.
When you configure the Treeview to use callbacks, you must put code in the
TreeNodePopulate event. This is the event where you put your logic to
return only the nodes you desire.

Here's more info and an example, as you requested:
http://SteveOrr.net/articles/Ajax.aspx
 
K

KJ

Hi Steve,

I checked out your article and have begun to try out the techniques. I
have a couple of questions.

Let's say I do need to update some other control's UI based on a click
that does performs an async callback. I can see that this is not
possible, because, as you state, the visual aspect of other controls
cannot be changed because the HTML is not re-rendered.

But is there any other way to accomplish this. I have, for example, a
page that has many controls whose visibility is not simply turned on
and off (which could easily be done client-side), but rather, the
visibility is dependent on the return values from database calls (i.e.,
the query determines the UI). Any ideas on getting around this one
without reposting the whole page?
 
R

rpraveen

KJ,

Like Steve mentions in his article this could be done manually by
registering appropriate code, implementing appropriate interfaces and
listenting to appropriate events. I could be wrong, but, I think this
approach may not maintain the ViewState for you. Steve, please clarify.

So, if you want a high-level solution for this, you could go the ATLAS
route where they provide a RefreshPanel (I believe) through which you
can easily refresh any portion of the page. I am not sure if they
maintain ViewState either.

Or, you could use a 3rd party solution like our's, Essential Tools for
ASP.Net from Syncfusion which comes with a CallbackPanel and
CallbackMultiplexer that does the same for you with great ease. Check
out the demos at:

http://www2.syncfusion.com/2.0/samples.aspx

Browse to Tools.web/CallbackControls. There are plenty of samples (with
code) that are similar to the scenario you mention above.

Regards,
Praveen
Syncfusion, Inc.
Complete set of ASP.Net controls and components
www.syncfusion.com/toolsweb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top