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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:06:08+00:00 2026-05-15T15:06:08+00:00

I have listed data for ASP.net control TreeView. I wanted to disable a particular

  • 0

I have listed data for ASP.net control TreeView. I wanted to disable a particular node/parentnode in the listed TreeView. I wanted to do this using jQuery.

  • 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-15T15:06:09+00:00Added an answer on May 15, 2026 at 3:06 pm

    if you take a simple treenode markup:

    <asp:TreeView runat="server" ID="myTreeView">
            <Nodes>
                <asp:TreeNode Text="Node 1 "/>                          
                <asp:TreeNode Text="Node 2"/>                           
                <asp:TreeNode Text="Node 3"/>                           
            </Nodes>
            <NodeStyle CssClass="treeNode" />
        </asp:TreeView>
    

    Then the default output for a single node is:

    <table cellspacing="0" cellpadding="0" style="border-width: 0pt;">
        <tbody><tr>
            <td><img alt="" src="/WebResource.axd?d=g57q362hyd_ZDMok5KQd0PqwW46aD7OdNOJZcZxqq5Q1&amp;t=634092817937234954"></td><td style="white-space: nowrap;" class="treeNode myTreeView_2"><a style="border-style: none; font-size: 1em;" id="myTreeViewt0" onclick="TreeView_SelectNode(myTreeView_Data, this,'myTreeViewt0');" href="javascript:__doPostBack('myTreeView','sNode 1 ')" class="myTreeView_0 treeNode myTreeView_1">Node 1 </a></td>
        </tr>
    </tbody></table>
    

    At this point you can see that the surrounding the a tag that gets generated receives the css class ‘treeNode’ so to select a specific node you could use the following selector:

    $(‘.treeNode:eq(0)’) to get the first node in the tree. there are other selectors you may prefer to use, see the selectors page on jQuery docs.

    Then you can do different things.

    • You can hide the node:

        $('.treeNode:eq(0)').hide();
      

    you can replace the a tag with text:

          var node = $('.treeNode:eq(0)'); //get the node element
          var nodeLink = $('a', node).hide() //get the link and hide it;
          node.append(nodeLink.text()); //get the text from the link and add it to the node
    

    or you can use a 3rd party jquery plugin to block the element (usually good while performing an ajax operation):

          - download the [blockui][2] plugin
          - reference the javascript file from your page (or masterpage)
          - then use this javascript call:
                to block:
                            $('.treeNode:eq(0)').block();
                unblock:
                             $('.treeNode:eq(0)').unblock(); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using ASP.NET Dynamic Data for a project and I have a table
I have a treeview on my ASP.Net page and for some reason the text
I have the following data (I have a lot more rows this is just
I have an ASP.Net MVC page where I want to use AJAX to update
I have written an ASP.NET page for a customer which uses the C# Facebook
Scenario: I have built an ASP.NET MVC application that manages my cooking recipes. I
I am using devbridge jquery autocomplete plugin . I have combined two tables in
I have created a WebSite in ASP.Net(Not Mvc. i forgot the other name). After
I use a form where i have listed the data from database like title,
I have a legacy ASP.NET site I'd like to improve a bit. One area

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.