I need some advice regarding conversion of an AJAX TreeView control to a LinkButton.
Why? To make the ASP.NET page lighter. Currently, when the Nodes of the TreeView is selected, records related to that node are displayed in a grid. This implementation makes the page heavy. So we decided to changed this to LinkButtons.
I just want know what are the things I need to do, consider, or is this a good idea? Honestly, whether this is a good or bad idea, I still need to do this.
My initial understanding is that this will turn out like a list ex: bullet list.
The following answer is based on your comment and builds on the answer provided in your other question.
The following example uses a ListView instead of a Repeater. ListViews are great because they’ll give you much more flexibility over a Repeater. Moreover, as you can see in the sample code below, binding the nested/child ListView and binding the nested/grandchild ListView can all be done declaratively without any code-behind.
Example of what the following code will produce
ASPX
C#
As you can see, in the C# code, I’ve created a list of “Person” as follows. Each Person object has a list of child Person objects and aach child Person object has a list of child Person objects. By creating your objects in this manner, binding the ListView is really as simple as I’ve shown. Use the Person object below to run a quick sample so you can see for yourself.
Person object
For your test, you can create a Page_Load method as follows:
See the following StackOverflow question to learn more about the differences between a Repeater and a ListView: Repeater, ListView, DataList, DataGrid, GridView … Which to choose?