|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
"AJAX" techniques for the ASPNET 2.0 TreeView control?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 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 Show quoteHide quote "KJ" <n_o_s_p_a***@mail.com> wrote in message news:1150838814.231111.100260@y41g2000cwy.googlegroups.com... > 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 > 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? Steve C. Orr [MVP, MCSD] wrote: Show quoteHide quote > 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 > > -- > I hope this helps, > Steve C. Orr, MCSD, MVP > http://SteveOrr.net > > > "KJ" <n_o_s_p_a***@mail.com> wrote in message > news:1150838814.231111.100260@y41g2000cwy.googlegroups.com... > > 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 > > Sure, you can use JavaScript to update page elements via client side script
depending on the return values you got from your AJAX call. Here's a more complex AJAX example where I demonstrate such things: http://SteveOrr.net/articles/WebChat.aspx Show quoteHide quote "KJ" <n_o_s_p_a***@mail.com> wrote in message news:1150909880.353553.237610@b68g2000cwa.googlegroups.com... > 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? > > > Steve C. Orr [MVP, MCSD] wrote: >> 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 >> >> -- >> I hope this helps, >> Steve C. Orr, MCSD, MVP >> http://SteveOrr.net >> >> >> "KJ" <n_o_s_p_a***@mail.com> wrote in message >> news:1150838814.231111.100260@y41g2000cwy.googlegroups.com... >> > 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 >> > > 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
Problem updating with TableAdapter in Detailsview.
Gridview right border on a per-column basis Validators - error message not showing when JS disabled & only server side validation occurs aspx and ascx ASP.NET 2.0 Intrinsic Treeview control errors on a specific machine Web User Controls(ascx) 1.1 VS 2.0 making a dropdownlist visible when clicking in a textbox of a detailsview? Gridview Header Template sorting Changing default behaviour of ASP.NET2 Menu control is the value passed via HiddenField to client-side always string? |
|||||||||||||||||||||||