Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6158413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:57:13+00:00 2026-05-23T20:57:13+00:00

I need some advice regarding conversion of an AJAX TreeView control to a LinkButton

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:57:14+00:00Added an answer on May 23, 2026 at 8:57 pm

    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

    enter image description here

    ASPX

    <asp:ListView runat="server" ID="lvw">
        <LayoutTemplate>
            <ul>
                <li id="itemPlaceholder" runat="server" />
            </ul>
        </LayoutTemplate>
        <ItemTemplate>
            <li>    
                <asp:LinkButton runat="server" CommandArgument='<%# Eval("Name")%>'><%# Eval("Name")%></asp:LinkButton>
                <asp:ListView runat="server" ID="lvw2" DataSource='<%# Eval("Children")%>'>
                    <LayoutTemplate>
                        <ul>
                            <li id="itemPlaceholder" runat="server" />
                        </ul>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <li><asp:LinkButton runat="server" CommandArgument='<%# Eval("Name")%>'><%# Eval("Name")%></asp:LinkButton>
                            <asp:ListView runat="server" ID="lvw3" DataSource='<%# Eval("Children")%>'>
                                <LayoutTemplate>
                                    <ul>
                                        <li id="itemPlaceholder" runat="server" />
                                    </ul>
                                </LayoutTemplate>
                                <ItemTemplate>
                                    <li><asp:LinkButton runat="server" CommandArgument='<%# Eval("Name")%>'><%# Eval("Name")%></asp:LinkButton></li>
                                </ItemTemplate>
                            </asp:ListView>
                        </li>
                    </ItemTemplate>
                </asp:ListView>
            </li>
        </ItemTemplate>
    </asp:ListView>
    

    C#

    lvw.DataSource = personList;
    lvw.DataBind();
    

    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

    public class Person
    {
        public string name { get; set; }
        public List<Person> Children { get; set; }
    }
    

    For your test, you can create a Page_Load method as follows:

    protected void Page_Load(object sender, EventArgs e)
        {
            List<Person> personList = new List<Person>();
            Person person1 = new Person() { name = "Child 1" };
            Person person2 = new Person() { name = "Child 2" };
            List<Person> childPersonList1 = new List<Person>();
            childPersonList1.Add(person1);
            childPersonList1.Add(person2);
            Person person3 = new Person() { name = "Person 1" };
            person3.Children = childPersonList1;
            personList.Add(person3);
            Person person4 = new Person() { name = "Child 3" };
            Person person10 = new Person() { name = "Grandchild 1" };
            Person person11 = new Person() { name = "Grandchild 2" };
            Person person12 = new Person() { name = "Grandchild 3" };
            List<Person> grandchildPersonList1 = new List<Person>();
            grandchildPersonList1.Add(person10);
            grandchildPersonList1.Add(person11);
            grandchildPersonList1.Add(person12);
            person4.Children = grandchildPersonList1;
            Person person5 = new Person() { name = "Child 4" };
            List<Person> childPersonList2 = new List<Person>();
            childPersonList2.Add(person4);
            childPersonList2.Add(person5);
            Person person6 = new Person() { name = "Person 2" };
            person6.Children = childPersonList2;
            personList.Add(person6);
            Person person7 = new Person() { name = "Child 5" };
            Person person8 = new Person() { name = "Child 6" };
            List<Person> childPersonList3 = new List<Person>();
            childPersonList3.Add(person7);
            childPersonList3.Add(person8);
            Person person9 = new Person() { name = "Person 3" };
            person9.Children = childPersonList3;
            personList.Add(person9);
    
            lvw.DataSource = personList;
            lvw.DataBind();
        }
    

    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?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some advice on techniques to perform page redirect in asp.net. Which one
I need some advice regarding the handling of a Silverlight control that I need
I'm developing an Asp.Net 3.5 application and I need to print some application generated
I need some advice regarding how to organize my data for effective and fast
I need an explanation regarding some advice I got on this site. I'm doing
I need some advice regarding the use of a command line utility from a
I need some clarification/advice regarding modifying objects stored in mutable containers in Objective-C. Let's
HI everyone, i need some advice regarding Visual Studio 2008 Pro. We develop a
I need some advice as to how I easily can separate test runs for
I need some advice on what kind of pattern(s) I should use for pushing/pulling

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.