473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

How do I get a node's value in javascript tree view?

4
<asp:TreeView ID="TreeView1" runat="server" >
<SelectedNodeStyle BackColor="LightGray" />
<Nodes>
<asp:TreeNode Text="A" Value="one"></asp:TreeNode>
<asp:TreeNode Text="B" Value="two"></asp:TreeNode>
<asp:TreeNode Text="C" Value="three"></asp:TreeNode>
<asp:TreeNode Text="D" Value="four"></asp:TreeNode>
</Nodes>
</asp:TreeView>

Here's the code for my treeview. How do I print out a nodes Value field in javascript?
Jul 17 '07 #1
4 7094
acoder
16,027 Expert Mod 8TB
Welcome to TSDN!

You can use:
Expand|Select|Wrap|Line Numbers
  1. document.getElementById("TreeView1").value
to retrieve the value. If you want to display this value, it depends on where you want to display it.
Jul 18 '07 #2
jimdxz
4
that doesn't work I tried it.
Jul 19 '07 #3
acoder
16,027 Expert Mod 8TB
that doesn't work I tried it.
Ok, how does the ASP code turn out in HTML?
Jul 19 '07 #4
gmail
8
Hi Friend,
Hope that it will help to you.

[quote=jimdxz]<asp:TreeView ID="TreeView1" runat="server" >
<SelectedNodeStyle BackColor="LightGray" />
<Nodes>
<asp:TreeNode url="a.aspx" Text="A" Value="one"></asp:TreeNode>
<asp:TreeNode url="b.aspx"Text="B" Value="two"></asp:TreeNode>
<asp:TreeNode Text="C" Value="three"></asp:TreeNode>
<asp:TreeNode Text="D" Value="four"></asp:TreeNode>
</Nodes>
</asp:TreeView>

cheers,
gmail
Aug 4 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Steve Roberts | last post by:
I want to write a graphical view of an XML tree, using a DOM interface, that allows the XML tree to be edited, with nodes being added or removed. For this I was going to create a basic tree...
0
by: Saradhi | last post by:
Hi All, Here I am facing a performance problem with the TreeView Node renaming. I am displaying a hierarchy Data in a treeview in my Windows C# Application. My tree view represents an...
8
by: Ryan Stewart | last post by:
Putting the following code in a page seems to make it go into an infinite loop unless you give it a very simple node to work with. Either that or it's very very slow. I'm somewhat new to this,...
3
by: Saradhi | last post by:
Hi All, Here I am facing a performance problem with the TreeView Node renaming. I am displaying a hierarchy Data in a treeview in my Windows C# Application. My tree view represents an...
3
by: Brian Henry | last post by:
If i already have a tree view created, and want to add another new node to it, how would i do so? Is there a way to throught tags or anything? like i have this RootNode | +-- Child 1 +--...
13
by: André Nogueira | last post by:
Hi there. I know you can view a node's fullpath property, but is it posible to select a node using its path? Like, tell the treeview that the node that should be selected is the node with the...
1
by: JN | last post by:
Hi All, I have a tree view which has parent nodes of each letter of the alphabet. The root node will be the customers name that relate to the parent node letter. I also have a gridview which is...
10
by: Simon Brooke | last post by:
The DOM API has included public Node importNode(Node,boolean) as a method of the Document interface for a long time. Does anything actually implement it? Xerces 2 is giving me: ...
1
by: BeginingOfLife | last post by:
i am using a java script to create a tree view in my html page. i got that script from this link : http://destroydrop.com/javascripts/tree/ given script is static script creations for tree...
1
by: happy.john1234 | last post by:
Hi, i am a new bie in programming.I am currently doing a project that displays certain hierarchial set of data in tree view.I currently implemented this tree view to be displayed in xml file ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.