Connecting Tech Pros Worldwide Forums | Help | Site Map

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

jm
Guest
 
Posts: n/a
#1: Nov 18 '05
<%@ 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.

Martin Dechev
Guest
 
Posts: n/a
#2: Nov 18 '05

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


Hi, jm,

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

Hope this helps
Martin
"jm" <john_20_28_2000@yahoo.com> wrote in message
news:c67e4bdd.0403010814.4bba3184@posting.google.c om...[color=blue]
> <%@ 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.[/color]


jm
Guest
 
Posts: n/a
#3: Nov 18 '05

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


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" <detcheff_@hotmail.com> wrote in message news:<e9KbRk6$DHA.1600@tk2msftngp13.phx.gbl>...[color=blue]
> Hi, jm,
>
> Page_load should be Page_Load in C# because it is case-sensitive language.
>
> Hope this helps
> Martin
> "jm" <john_20_28_2000@yahoo.com> wrote in message
> news:c67e4bdd.0403010814.4bba3184@posting.google.c om...[color=green]
> > <%@ 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.[/color][/color]
jm
Guest
 
Posts: n/a
#4: Nov 18 '05

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


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

"Laurent Jordi" <laurent@ezlogic.mc> wrote in message news:<O50NU$EAEHA.2632@TK2MSFTNGP12.phx.gbl>...[color=blue]
> 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" <john_20_28_2000@yahoo.com> a écrit dans le message de news:
> c67e4bdd.0403011909.1d8e7004@posting.google.com...[color=green]
> > 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[/color]
> design.[color=green]
> >
> > "Martin Dechev" <detcheff_@hotmail.com> wrote in message[/color]
> news:<e9KbRk6$DHA.1600@tk2msftngp13.phx.gbl>...[color=green][color=darkred]
> > > Hi, jm,
> > >
> > > Page_load should be Page_Load in C# because it is case-sensitive[/color][/color]
> language.[color=green][color=darkred]
> > >
> > > Hope this helps
> > > Martin
> > > "jm" <john_20_28_2000@yahoo.com> wrote in message
> > > news:c67e4bdd.0403010814.4bba3184@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.[/color][/color][/color]
Closed Thread