Right, so I have to build a web app in asp.net 2.0 winforms. Id much much much prefer 3.5 MVC. because its cleaner, leaner, more modern and makes more sense to me. I know 3.5 MVC well, and have come from a Rails background, so this webforms stuff looks kinda gross to me :P.
Anyway, I need an AJAX-backed tree control, one that loads the subtrees via ajax when nodes are expanded.
In Asp MVC i would do something like making a partial representing a single node, and a jQuery AJAX triggered controller action that renders a collection of these partials(the children) which is inserted into the target's children div's innerHTML.
AFAIC, in .net 2.0 my options are:
Make a Webforms control that represents a single node. Use Asp AJAX to call a codebehind method that recursivley adds controls representing the children of this node. Pros: fits well within the offical asp 2.0 framework. Pretty easy. Cons: webforms are gross(:p), and makes upgrading this site to 3.5 later much harder.
Make a webservices method that returns the children as a JSON list, which are then formatted to HTML in client-side javascript, using jQuery for the requesting and formatting. Pros: Speedy due to low overheads with json. More future-proof, as json-webservices easily transition to MVC controller methods. Cons: More work to develop. HTML ends up mixed up in with the clientside javascript(because theres no JSON/javascript templating availible), which is hideous(IMHO).
use a third party web control. Pros: least work(in best case). Cons: have to evalutate which one to use. may have to purchase. Learning/dealing with control api, etc.
Some other way?
So what do you guys think is the best way to go?