When deciding where to implement your programming logic, consider the trade-offs between speed and efficiency. Opting for a tree view control that does not rely on table layout, coupled with a javascript framework to handle click events, can improve performance. Using ashx handler files for AJAX communication can also reduce overhead compared to aspx and calling page methods. Remember to ensure that AJAX calls and responses only contain JSON or XML data, not HTML.
On the other hand, using rapid application development tools like Visual Studio and the TreeView control can facilitate quick web application development. However, there are drawbacks such as the need to handle every click/select event on the server, which can lead to issues with page life cycle processing and increased data transfer for AJAX calls (including transfer of ViewState and HTML for each AJAX event).
If you choose to stick with the TreeView control, consider the following recommendations:
- Utilize CSS Friendly Control Adapter to reduce the size of generated HTML and replace table layout with ul/li elements
- Wrap the TreeView inside an ASP.NET AJAX UpdatePanel, focusing only on the TreeView itself, and use conditional updates of the panel. Don't hesitate to use multiple updatepanels if needed
- Keep ViewState minimal to optimize performance