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 6245141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:27:14+00:00 2026-05-24T12:27:14+00:00

Right now I am using a ASP.NET TreeView with checkboxes enabled in my page,

  • 0

Right now I am using a ASP.NET TreeView with checkboxes enabled in my page, and I dynamically populate the tree in the C# code behind by using node values to store id’s obtained from the db. On postback, I iterate through the nodes and get the checked ones and store back in the db.

To get tri-state checkboxes(not possible in the ASP.NET TreeView), I want to move to a jQuery Treeview. The most promising one seems to be Dynatree at http://wwwendt.de/tech/dynatree/doc/samples.html (click persistence on the left.)

Is there some other free ASP.NET Treeview with checkboxes that can be used?

To populate the dynatree, I am thinking of writing UL and LI elements to a ASP.NET LiteralControl and then configuring Dynatree in the html to populate the tree with that DIV. Is this the best way? Do I put the node id in the li id as it’s suggested in the docs so that I can read it back at the backend?

However, I am not able to find an easy way to read the values back in the codebehind to store in the db..
i.e how to see if a checkbox node was checked in the C# code?
The docs say this:
// Get a JavaScript object copy of the tree
var dict = $(“#tree”).dynatree(“getTree”).toDict();
// … then use Ajax to send this to your server…

Can it be seen in the postback button click event somehow without using ajax, use hidden asp.net controls and read it in the postback?

Documentation is here http://wwwendt.de/tech/dynatree/doc/dynatree-doc.html

  • 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-24T12:27:15+00:00Added an answer on May 24, 2026 at 12:27 pm

    One way round it is setting a hidden field to be a string containing all the selected ids delimited by a chosen character. On postback you can then process this by splitting the string using the delimiter to get an array of ids to update.

    Initialize the tree with a javascript section similar to:

    $("#tree").dynatree({
            title: "Title",
            checkbox: true,
            selectMode: 2,
            onSelect: function() {
                var tree = $("#tree").dynatree("getTree");
                var selKeys = $.map(tree.getSelectedNodes(), function(node){
                    return node.data.key;
                });
                document.getElementById("<%= hiddenfieldname.ClientID %>").value = selKeys.join("|");
            }
        });
    

    Then some C# along the lines of:

    var objectIds = hiddenfieldname.Value.Split("|");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What are the most popular architecture with dotnet? Right now i am using ASP.NET
I'm currently working on web application using VB in ASP.NET. Right now I have
Using Asp.net and jQuery I have a GridView with a CheckBox column. Right now
Right now I'm using the following code in my markup: <asp:HiddenField ID=TheName runat=server Value=<%#Eval(SpeakerName)%>
My development team is using ASP.NET 3.5 / 4.0 right now, and our sites
Right now I am using an asp.net image button for my login button. I
I am learning how to create a website using ASP.NET & C#. Right now
I'm currently developing an app using ASP.NET MVC3 and Entity Framework 4.1 Code First
I'd like to use jQuery's dialog to replace some code I'm using right now
I'm stuck in an advanced ASP.NET class right now and my instructor just put

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.