473,800 Members | 2,523 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using the Treeview Webcontrol

Hello,

I am a newbie to asp.net and I am trying to do sample code using the
treeview code, and for some reason it is not displaying the way I would
expect it to display. HEre is the code in question

<%@ Import Namespace="Micr osoft.Web.UI.We bControls" %>
<%@ Register TagPrefix="IE"
Namespace="Micr osoft.Web.UI.We bControls"
Assembly="Micro soft.Web.UI.Web Controls" %>

<script runat="server">
sub TreeView_Select edIndexChanged( s as object, e as TreeViewSelectE ventArgs)
lblSelectedNode .text = treeBooks.GetNo deFromIndex(e.N ewNode).Text
end sub
</script>

<html>
<head><title>Te st</title></head>
<body>
<form runat="Server">
<IE:TreeView
id="treeBooks"
AutoPostBack="T rue"
OnSelectedIndex Change="TreeVie w_SelectedIndex Changed"
Runat="Server">
<TreeNode Text="Home" >
<TreeNode
Text="test" />
<TreeNode
Text="test2" />
</TreeNode>
</IE:TreeView>
<asp:label id="lblSelected Node" Runat="server" />
</form>
</body>
</html>

I was expecting a tree view to display a node of Home and then subnodes test
and test2, but it doesn't do that, it just displays the items on the screen.
Thanks in advance for any help that is given on this.


Nov 18 '05 #1
2 2053
figured it out.

"Irishmanin usa"
<jd***@structuc tureinteractive .com.takemeoffi fyouwantoemailm e> wrote in
message news:uU******** ******@TK2MSFTN GP12.phx.gbl...
Hello,

I am a newbie to asp.net and I am trying to do sample code using the
treeview code, and for some reason it is not displaying the way I would
expect it to display. HEre is the code in question

<%@ Import Namespace="Micr osoft.Web.UI.We bControls" %>
<%@ Register TagPrefix="IE"
Namespace="Micr osoft.Web.UI.We bControls"
Assembly="Micro soft.Web.UI.Web Controls" %>

<script runat="server">
sub TreeView_Select edIndexChanged( s as object, e as TreeViewSelectE ventArgs) lblSelectedNode .text = treeBooks.GetNo deFromIndex(e.N ewNode).Text
end sub
</script>

<html>
<head><title>Te st</title></head>
<body>
<form runat="Server">
<IE:TreeView
id="treeBooks"
AutoPostBack="T rue"
OnSelectedIndex Change="TreeVie w_SelectedIndex Changed"
Runat="Server">
<TreeNode Text="Home" >
<TreeNode
Text="test" />
<TreeNode
Text="test2" />
</TreeNode>
</IE:TreeView>
<asp:label id="lblSelected Node" Runat="server" />
</form>
</body>
</html>

I was expecting a tree view to display a node of Home and then subnodes test and test2, but it doesn't do that, it just displays the items on the screen. Thanks in advance for any help that is given on this.

Nov 18 '05 #2
Hi,

MS TreeView Control is not working properly - as far as I have tested please
try with modified controls.

http://www.aspheute.com/artikel/20020801.htm

get back to me if not getting correctly,

Harsh
"Irishmanin usa"
<jd***@structuc tureinteractive .com.takemeoffi fyouwantoemailm e> wrote in
message news:uU******** ******@TK2MSFTN GP12.phx.gbl...
Hello,

I am a newbie to asp.net and I am trying to do sample code using the
treeview code, and for some reason it is not displaying the way I would
expect it to display. HEre is the code in question

<%@ Import Namespace="Micr osoft.Web.UI.We bControls" %>
<%@ Register TagPrefix="IE"
Namespace="Micr osoft.Web.UI.We bControls"
Assembly="Micro soft.Web.UI.Web Controls" %>

<script runat="server">
sub TreeView_Select edIndexChanged( s as object, e as TreeViewSelectE ventArgs) lblSelectedNode .text = treeBooks.GetNo deFromIndex(e.N ewNode).Text
end sub
</script>

<html>
<head><title>Te st</title></head>
<body>
<form runat="Server">
<IE:TreeView
id="treeBooks"
AutoPostBack="T rue"
OnSelectedIndex Change="TreeVie w_SelectedIndex Changed"
Runat="Server">
<TreeNode Text="Home" >
<TreeNode
Text="test" />
<TreeNode
Text="test2" />
</TreeNode>
</IE:TreeView>
<asp:label id="lblSelected Node" Runat="server" />
</form>
</body>
</html>

I was expecting a tree view to display a node of Home and then subnodes test and test2, but it doesn't do that, it just displays the items on the screen. Thanks in advance for any help that is given on this.

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1377
by: Jim M | last post by:
Is there any way to know what node was clicked in a treeview webcontrol where autopostback is false? Thanks in advance.
0
1277
by: clintonG | last post by:
I'm just wondering how rich the TreeView control actually is having never worked with a tree view control. I want to load XML into the tree and I'd like control of the presentation tier by getting rid of the folder icons. In fact if possible, I'd like to display the name of each node as a literal representation of the node itself, i.e. <title> or <link> as the case may be. I also wonder if this particular control supports nested...
1
4008
by: Hutty | last post by:
I would like to convert the code below into an asp.net application where I can run it via the web. It works ok for vb.net, but my goal is to do it through the browser. I have in a few areas, in particular the "application.startuppath" where it's not part of the System.Web. HttpApplicationState. Another area is "trv.Nodes.Add(text_line.Trim())" where value of type string cannot be converted to Microsoft.web.ui.webcontrol.treenode. ...
0
1016
by: viktor9990 | last post by:
I need to add, delete and move up and down hierarchical information in a treeview webcontrol. (all data is saved in Sql server database and must be shown dynamically in a treeview webcontrol (SDK 1.1) when the user clicks the appropriate button near the relevant node). Do you have any idea how to do that? Any example code? which methods or properties are helpful to solve the problem? Thanks.
0
1509
by: shen.chang.cs | last post by:
Hi, all, I use .Net V2.0 and WebControl TreeView. I want to have an OnClick() function to handle user click on certain end nodes but not on other nodes. Someone suggested to use a Java Scripts: <SCRIPT lang="jscript"> function MyTreeView_onclick( ) { Action1("onclick" );
5
2010
by: david | last post by:
I do not know if there is a treeView control for web form in .NET 1.1. I know there is IE Webcontrol package which has the treeview control for ..net 1.0. I have tested it in .net 1.1 before. It did not work. About the status of it now? Is there any alternative for TreeView control for web form in .net 1.1 and Visual Studio 2003? How about .net 2.0 and Visual Studio 2005? Thank tou David
7
6543
by: Jonas | last post by:
Hi. I'm trying to develop a web custom control that uses a programmatically created treeview. My problem is that I get an exception when I try to render the control. With properties do I have to assign to get this working. Here is some sample code: namespace WebControlLibrary1 {
1
3652
by: Victor Rodriguez | last post by:
Is there a way that I can have a client side event like oncontextmenu="showfunction();" on each node? thanks, Victor
0
1615
by: Vaibhav Shah | last post by:
Hi, While loading a user control with IE WebControl's tree view in it, on a webpart, i am getting this error. Error: unable to load ~\UserControls\TreeViewControl.ascx Details: Parser Error: Could not load type Microsoft.Web.UI.WebControls.Design.CssCollectionEditor from assembly mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
0
9690
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10501
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10032
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7574
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5603
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.