Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Excute code from treeview node click

Reply
Thread Tools

Excute code from treeview node click

 
 
Mark Goldin
Guest
Posts: n/a
 
      01-25-2004
I'd like to run some script (on a client) when the user selects a node.
How do I do that?


 
Reply With Quote
 
 
 
 
CMA
Guest
Posts: n/a
 
      01-26-2004
in the navigation url field of the tree node put "javascriptrocess();" and
put the process() function in the page in <script> section.
so then it will be getting executed.

hope this helps,
CMA


"Mark Goldin" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I'd like to run some script (on a client) when the user selects a node.
> How do I do that?
>
>



 
Reply With Quote
 
 
 
 
Mark Goldin
Guest
Posts: n/a
 
      01-27-2004
What is a name of that property?

"CMA" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> in the navigation url field of the tree node put "javascriptrocess();"

and
> put the process() function in the page in <script> section.
> so then it will be getting executed.
>
> hope this helps,
> CMA
>
>
> "Mark Goldin" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > I'd like to run some script (on a client) when the user selects a node.
> > How do I do that?
> >
> >

>
>



 
Reply With Quote
 
CMA
Guest
Posts: n/a
 
      01-27-2004
<body MS_POSITIONING="GridLayout">

<form id="ocx" method="post" runat="server">

<iewc:TreeView id="TreeView1" style="Z-INDEX: 102; LEFT: 337px; POSITION:
absolute; TOP: 114px" runat="server"
SystemImagesPath="/webctrl_client/1_0/treeimages/">

<iewc:TreeNode NavigateUrl="javascript:alert('1');"
Text="Node0"></iewc:TreeNode>

<iewc:TreeNode NavigateUrl="javascript:alert('1');"
Text="Node1"></iewc:TreeNode>

</iewc:TreeView>

</form>

</body>

when you click on the node, will excecute the javascropt. to your need,
include a javasript function name without using alert()





"Mark Goldin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> What is a name of that property?
>
> "CMA" <(E-Mail Removed)> wrote in message
> news:#(E-Mail Removed)...
> > in the navigation url field of the tree node put "javascriptrocess();"

> and
> > put the process() function in the page in <script> section.
> > so then it will be getting executed.
> >
> > hope this helps,
> > CMA
> >
> >
> > "Mark Goldin" <(E-Mail Removed)> wrote in message
> > news:%(E-Mail Removed)...
> > > I'd like to run some script (on a client) when the user selects a

node.
> > > How do I do that?
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Mark Goldin
Guest
Posts: n/a
 
      01-27-2004
Thanks for all your help.

"CMA" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> <body MS_POSITIONING="GridLayout">
>
> <form id="ocx" method="post" runat="server">
>
> <iewc:TreeView id="TreeView1" style="Z-INDEX: 102; LEFT: 337px; POSITION:
> absolute; TOP: 114px" runat="server"
> SystemImagesPath="/webctrl_client/1_0/treeimages/">
>
> <iewc:TreeNode NavigateUrl="javascript:alert('1');"
> Text="Node0"></iewc:TreeNode>
>
> <iewc:TreeNode NavigateUrl="javascript:alert('1');"
> Text="Node1"></iewc:TreeNode>
>
> </iewc:TreeView>
>
> </form>
>
> </body>
>
> when you click on the node, will excecute the javascropt. to your need,
> include a javasript function name without using alert()
>
>
>
>
>
> "Mark Goldin" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > What is a name of that property?
> >
> > "CMA" <(E-Mail Removed)> wrote in message
> > news:#(E-Mail Removed)...
> > > in the navigation url field of the tree node put

"javascriptrocess();"
> > and
> > > put the process() function in the page in <script> section.
> > > so then it will be getting executed.
> > >
> > > hope this helps,
> > > CMA
> > >
> > >
> > > "Mark Goldin" <(E-Mail Removed)> wrote in message
> > > news:%(E-Mail Removed)...
> > > > I'd like to run some script (on a client) when the user selects a

> node.
> > > > How do I do that?
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Mark Goldin
Guest
Posts: n/a
 
      01-27-2004
Is it possible to to send an atribute value thru NavigateUrl?
Something like this:
NavigateUrl="javascript:functionname(attributename );"

"CMA" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> <body MS_POSITIONING="GridLayout">
>
> <form id="ocx" method="post" runat="server">
>
> <iewc:TreeView id="TreeView1" style="Z-INDEX: 102; LEFT: 337px; POSITION:
> absolute; TOP: 114px" runat="server"
> SystemImagesPath="/webctrl_client/1_0/treeimages/">
>
> <iewc:TreeNode NavigateUrl="javascript:alert('1');"
> Text="Node0"></iewc:TreeNode>
>
> <iewc:TreeNode NavigateUrl="javascript:alert('1');"
> Text="Node1"></iewc:TreeNode>
>
> </iewc:TreeView>
>
> </form>
>
> </body>
>
> when you click on the node, will excecute the javascropt. to your need,
> include a javasript function name without using alert()
>
>
>
>
>
> "Mark Goldin" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > What is a name of that property?
> >
> > "CMA" <(E-Mail Removed)> wrote in message
> > news:#(E-Mail Removed)...
> > > in the navigation url field of the tree node put

"javascriptrocess();"
> > and
> > > put the process() function in the page in <script> section.
> > > so then it will be getting executed.
> > >
> > > hope this helps,
> > > CMA
> > >
> > >
> > > "Mark Goldin" <(E-Mail Removed)> wrote in message
> > > news:%(E-Mail Removed)...
> > > > I'd like to run some script (on a client) when the user selects a

> node.
> > > > How do I do that?
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
CMA
Guest
Posts: n/a
 
      01-27-2004
same way you can specify the attribute while creating the tree, right?

<script language=javascript>
function tell(strVal)
{
alert(strVal);
}
</script>


<iewc:TreeNode NavigateUrl="javascript:alert('0th element');" Text="Node0"
ID="node00"></iewc:TreeNode>
<iewc:TreeNode NavigateUrl="javascript:tell('1st element');" Text="Node1"
ID="node11"></iewc:TreeNode>

likewise you can give the ID to the parameter also.
i mean not like tell(this.ID); // it is not working
when creating you know the ID of the node, so u can set the parameter to the
ID.
like if the ID of the node is "aaaa1111",
then set the function as, tell('aaaa1111');

CMA


 
Reply With Quote
 
Mark Goldin
Guest
Posts: n/a
 
      01-27-2004
I see.
That's what I do in my none-net development.
I thought that dontnet is really something new.
Is it possible to have tree data available on the client side?

"CMA" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> same way you can specify the attribute while creating the tree, right?
>
> <script language=javascript>
> function tell(strVal)
> {
> alert(strVal);
> }
> </script>
>
>
> <iewc:TreeNode NavigateUrl="javascript:alert('0th element');" Text="Node0"
> ID="node00"></iewc:TreeNode>
> <iewc:TreeNode NavigateUrl="javascript:tell('1st element');" Text="Node1"
> ID="node11"></iewc:TreeNode>
>
> likewise you can give the ID to the parameter also.
> i mean not like tell(this.ID); // it is not working
> when creating you know the ID of the node, so u can set the parameter to

the
> ID.
> like if the ID of the node is "aaaa1111",
> then set the function as, tell('aaaa1111');
>
> CMA
>
>



 
Reply With Quote
 
CMA
Guest
Posts: n/a
 
      01-28-2004
yes, the process is somewhat same. but the architecture is different. in
asp, you execute the page line by line and give the output to the client
side. in .net, the whole page will execute and give the output to the user
at once. and server side programming is easy since all the libraries r
available.

what do u mean by "tree data " can u explain a bit more???

CMA


"Mark Goldin" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I see.
> That's what I do in my none-net development.
> I thought that dontnet is really something new.
> Is it possible to have tree data available on the client side?
>
> "CMA" <(E-Mail Removed)> wrote in message
> news:#(E-Mail Removed)...
> > same way you can specify the attribute while creating the tree, right?
> >
> > <script language=javascript>
> > function tell(strVal)
> > {
> > alert(strVal);
> > }
> > </script>
> >
> >
> > <iewc:TreeNode NavigateUrl="javascript:alert('0th element');"

Text="Node0"
> > ID="node00"></iewc:TreeNode>
> > <iewc:TreeNode NavigateUrl="javascript:tell('1st element');"

Text="Node1"
> > ID="node11"></iewc:TreeNode>
> >
> > likewise you can give the ID to the parameter also.
> > i mean not like tell(this.ID); // it is not working
> > when creating you know the ID of the node, so u can set the parameter to

> the
> > ID.
> > like if the ID of the node is "aaaa1111",
> > then set the function as, tell('aaaa1111');
> >
> > CMA
> >
> >

>
>



 
Reply With Quote
 
Mark Goldin
Guest
Posts: n/a
 
      01-28-2004
I meant since xml is loaded into the tree it would be possible to access it
on the client.
Is it all wrong?

"CMA" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> yes, the process is somewhat same. but the architecture is different. in
> asp, you execute the page line by line and give the output to the client
> side. in .net, the whole page will execute and give the output to the user
> at once. and server side programming is easy since all the libraries r
> available.
>
> what do u mean by "tree data " can u explain a bit more???
>
> CMA
>
>
> "Mark Goldin" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > I see.
> > That's what I do in my none-net development.
> > I thought that dontnet is really something new.
> > Is it possible to have tree data available on the client side?
> >
> > "CMA" <(E-Mail Removed)> wrote in message
> > news:#(E-Mail Removed)...
> > > same way you can specify the attribute while creating the tree, right?
> > >
> > > <script language=javascript>
> > > function tell(strVal)
> > > {
> > > alert(strVal);
> > > }
> > > </script>
> > >
> > >
> > > <iewc:TreeNode NavigateUrl="javascript:alert('0th element');"

> Text="Node0"
> > > ID="node00"></iewc:TreeNode>
> > > <iewc:TreeNode NavigateUrl="javascript:tell('1st element');"

> Text="Node1"
> > > ID="node11"></iewc:TreeNode>
> > >
> > > likewise you can give the ID to the parameter also.
> > > i mean not like tell(this.ID); // it is not working
> > > when creating you know the ID of the node, so u can set the parameter

to
> > the
> > > ID.
> > > like if the ID of the node is "aaaa1111",
> > > then set the function as, tell('aaaa1111');
> > >
> > > CMA
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant access TreeView Node frm Btn Click event after populating frm another click even chandrajit_in ASP .Net 0 01-03-2008 10:45 AM
How to find node in TreeView by using string(the same as Node.Text) ? jiing ASP .Net 0 04-27-2007 02:34 AM
xsl variable $node/text() but $node can non-node-set help! Tjerk Wolterink XML 2 08-24-2006 03:28 AM
How to set the node indent property between the parent node and the leaf node viveknatani@gmail.com ASP .Net 0 02-13-2006 07:11 PM
How to drag a sub-node to another node in TreeView? wolf ASP .Net 0 08-18-2004 11:51 PM



Advertisments