473,394 Members | 1,752 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,394 software developers and data experts.

Please tell me if I am doing this treeview correctly. Thank you.

jm
<%@ Page Language="c#" autoeventwireup="false" %>
<%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls" %>
<script runat="server">

void Page_load(object sender, EventArgs e) {
// Create the first TreeNode
TreeNode tvFirst = new TreeNode();
tvFirst.Text = "First Tree Node";

// Create the second TreeNode
TreeNode tvSecond = new TreeNode();
tvSecond.Text = "Second Tree Node";

// Add the second TreeNode as a child of the first
tvFirst.Nodes.Add(tvSecond);

// Add the first TreeNode to the TreeView's root TreeNodes
TreeView1.Nodes.Add(tvFirst);
}

</script>
<html>
<head>
</head>
<body>
<form runat="server">
<iewc:TreeView id="TreeView1" runat="server">
<iewc:TreeNodeType></iewc:TreeNodeType>
</iewc:TreeView>
</p>
</form>
</body>
</html>
The page loads with no errors. I simply get nothing on the page
displayed. Is there some method I have to do so that I can see the
nodes I have added? I know treeview works on my system as I can hard
code nodes. Thank you.
Nov 18 '05 #1
3 1090
Hi, jm,

Page_load should be Page_Load in C# because it is case-sensitive language.

Hope this helps
Martin
"jm" <jo*************@yahoo.com> wrote in message
news:c6**************************@posting.google.c om...
<%@ Page Language="c#" autoeventwireup="false" %>
<%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls" %>
<script runat="server">

void Page_load(object sender, EventArgs e) {
// Create the first TreeNode
TreeNode tvFirst = new TreeNode();
tvFirst.Text = "First Tree Node";

// Create the second TreeNode
TreeNode tvSecond = new TreeNode();
tvSecond.Text = "Second Tree Node";

// Add the second TreeNode as a child of the first
tvFirst.Nodes.Add(tvSecond);

// Add the first TreeNode to the TreeView's root TreeNodes
TreeView1.Nodes.Add(tvFirst);
}

</script>
<html>
<head>
</head>
<body>
<form runat="server">
<iewc:TreeView id="TreeView1" runat="server">
<iewc:TreeNodeType></iewc:TreeNodeType>
</iewc:TreeView>
</p>
</form>
</body>
</html>
The page loads with no errors. I simply get nothing on the page
displayed. Is there some method I have to do so that I can see the
nodes I have added? I know treeview works on my system as I can hard
code nodes. Thank you.

Nov 18 '05 #2
jm
Thanks.

I changed that and it still didn't work. I found that the line:

autoeventwireup="false"

has to be set to true or removed. I don't know if that's a bug or by design.

"Martin Dechev" <de*******@hotmail.com> wrote in message news:<e9**************@tk2msftngp13.phx.gbl>...
Hi, jm,

Page_load should be Page_Load in C# because it is case-sensitive language.

Hope this helps
Martin
"jm" <jo*************@yahoo.com> wrote in message
news:c6**************************@posting.google.c om...
<%@ Page Language="c#" autoeventwireup="false" %>
<%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls" %>
<script runat="server">

void Page_load(object sender, EventArgs e) {
// Create the first TreeNode
TreeNode tvFirst = new TreeNode();
tvFirst.Text = "First Tree Node";

// Create the second TreeNode
TreeNode tvSecond = new TreeNode();
tvSecond.Text = "Second Tree Node";

// Add the second TreeNode as a child of the first
tvFirst.Nodes.Add(tvSecond);

// Add the first TreeNode to the TreeView's root TreeNodes
TreeView1.Nodes.Add(tvFirst);
}

</script>
<html>
<head>
</head>
<body>
<form runat="server">
<iewc:TreeView id="TreeView1" runat="server">
<iewc:TreeNodeType></iewc:TreeNodeType>
</iewc:TreeView>
</p>
</form>
</body>
</html>
The page loads with no errors. I simply get nothing on the page
displayed. Is there some method I have to do so that I can see the
nodes I have added? I know treeview works on my system as I can hard
code nodes. Thank you.

Nov 18 '05 #3
jm
It is fine. But what does it do that I can't do for free (and meet my
current needs)?

"Laurent Jordi" <la*****@ezlogic.mc> wrote in message news:<O5**************@TK2MSFTNGP12.phx.gbl>...
Could you have a look in http://www.eztree-msdn.com and told me if you could
be interested with this kind of solution (No plugin)

There is 400 000 records in there

Regards

"jm" <jo*************@yahoo.com> a écrit dans le message de news:
c6**************************@posting.google.com...
Thanks.

I changed that and it still didn't work. I found that the line:

autoeventwireup="false"

has to be set to true or removed. I don't know if that's a bug or by

design.

"Martin Dechev" <de*******@hotmail.com> wrote in message

news:<e9**************@tk2msftngp13.phx.gbl>...
Hi, jm,

Page_load should be Page_Load in C# because it is case-sensitive language.
Hope this helps
Martin
"jm" <jo*************@yahoo.com> wrote in message
news:c6**************************@posting.google.c om...
> <%@ Page Language="c#" autoeventwireup="false" %>
> <%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls"
> Assembly="Microsoft.Web.UI.WebControls" %>
> <script runat="server">
>
> void Page_load(object sender, EventArgs e) {
>
>
> // Create the first TreeNode
> TreeNode tvFirst = new TreeNode();
> tvFirst.Text = "First Tree Node";
>
> // Create the second TreeNode
> TreeNode tvSecond = new TreeNode();
> tvSecond.Text = "Second Tree Node";
>
> // Add the second TreeNode as a child of the first
> tvFirst.Nodes.Add(tvSecond);
>
> // Add the first TreeNode to the TreeView's root TreeNodes
> TreeView1.Nodes.Add(tvFirst);
> }
>
> </script>
> <html>
> <head>
> </head>
> <body>
> <form runat="server">
> <iewc:TreeView id="TreeView1" runat="server">
> <iewc:TreeNodeType></iewc:TreeNodeType>
> </iewc:TreeView>
> </p>
> </form>
> </body>
> </html>
>
>
> The page loads with no errors. I simply get nothing on the page
> displayed. Is there some method I have to do so that I can see the
> nodes I have added? I know treeview works on my system as I can hard
> code nodes. Thank you.

Nov 18 '05 #4

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

Similar topics

6
by: Brian Smith | last post by:
Is there a way to avoid the default action of TreeNode expansion/contraction caused by double click? I can add an event handler to pop up my properties dialog on double click, but it has the...
3
by: Hazz | last post by:
I am just beginning to design a Treeview display (winforms) for wine regions. Problem. Some wine growing regions belong to two counties. Eg. Carneros is in both Napa and Sonoma Counties. Although...
2
by: Guy Lafleur | last post by:
I have a user control that builds a treeview dynamically in the Page_Load event. Also, I have the AutoEventWireup property set to true (i.e., <%@ Control AutoEventWireup="true" %>). Then, when I...
2
by: SStory | last post by:
Here is the situation. I want to display Icons, Type of file etc from a file extension. Upon initial program load I may only need icons for certain files. But other operations will require...
2
by: garyusenet | last post by:
I could do with something similiar, can you tell me if you think this would work for me, and if there's any advantage in working with controls this way than how I currently am. At the moment...
5
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...
17
by: Amy | last post by:
Hi, I finished this script and for some reason there is a delay every so often in the timing. Sometimes it seems two take 2 seconds instead of 1. Can anyone see anything that would slow it down? I...
0
by: 2Barter.net | last post by:
" Given BACK what was freely GIVEN " More options 2 messages - Expand all 2Barter.net View profile More options Dec 12, 9:48 pm Blessing Are Country
0
by: simon | last post by:
hello, I was hoping someone could help me with an issue (using vb & .net 2.0) I have a datagrid and the first column shown i have an asp:textbox that i basically want to "group by" an ID and only...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.