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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:55:04+00:00 2026-05-30T03:55:04+00:00

I need your support because I have got very difficult problem. I would like

  • 0

I need your support because I have got very difficult problem. I would like to take attribute using TreeView1.SelectedNode but I do not know what should I write there to get attribute.

This is my Xml tree:

<?xml version="1.0" encoding="utf-8"?>
<ubrania>
  <damska>
    <nk id="Nowa Kolekcja">

      <item>
        <id>1</id>

      </item>
      <item>
        <id>2</id>

      </item>

    </nk>
    <pm id="Nowosci">

      <item>
        <id>3</id>

      </item>
      <item>
        <id>4</id>

      </item>

    </pm>

  </damska>


</ubrania>

IF I will write this: (when I will click on node “nk” I get only value “nk” but I need attribute “Nowa Kolekcja” when I will click on “nk”)

protected void TreeView1_SelectedNodeChanged2(object sender, EventArgs e)
        {
            Label2.Text = TreeView1.SelectedNode.Value;
         }
  • 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-30T03:55:05+00:00Added an answer on May 30, 2026 at 3:55 am

    I assume you are using asp:XmlDataSource and asp:TreeView. you have to setup for the Value of TreeNode.
    Following is my test code:

    <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/XMLFile1.xml">
    </asp:XmlDataSource>
    
    <asp:TreeView ID="TreeView1" runat="server" DataSourceID="XmlDataSource1" 
        onselectednodechanged="TreeView1_SelectedNodeChanged">
        <DataBindings>
            <asp:TreeNodeBinding DataMember="nk" TextField="#Name" ValueField="id" />
        </DataBindings>
    </asp:TreeView>
    

    TextField=”#Name” means displaying element name.

    ValueField=”id” means set Value of TreeNode as the content of id attribute.

    C# code is simple:

    protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
    {
        string attr = TreeView1.SelectedNode.Value;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need your expertise once again. I have a java class that searches a
I need your help, For example I have a decimal type variable and I
I really need your help in my issue very quickly and it's too close
.NET developers out there! Need your opinion here! I am now using Visual Assist
I need to pre-compress some very large html/xml/json files (large data dumps) using either
I need your help to define a special case in XML schema: A sequence
I need your advice about framework selection (Java vs Mono) for a new large
I need your advice on this piece of code: the table fields options[0], options[1]
I really need your help for this. I am relatively new to programming and
I'm completely stuck and need your help... I've created a webservice stub with jaxb

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.