Excute code from treeview node click

Discussion in 'ASP .Net Web Controls' started by Mark Goldin, Jan 25, 2004.

  1. Mark Goldin

    Mark Goldin Guest

    I'd like to run some script (on a client) when the user selects a node.
    How do I do that?
     
    Mark Goldin, Jan 25, 2004
    #1
    1. Advertising

  2. Mark Goldin

    CMA Guest

    in the navigation url field of the tree node put "javascript:process();" and
    put the process() function in the page in <script> section.
    so then it will be getting executed.

    hope this helps,
    CMA


    "Mark Goldin" <> wrote in message
    news:%...
    > I'd like to run some script (on a client) when the user selects a node.
    > How do I do that?
    >
    >
     
    CMA, Jan 26, 2004
    #2
    1. Advertising

  3. Mark Goldin

    Mark Goldin Guest

    What is a name of that property?

    "CMA" <> wrote in message
    news:#...
    > in the navigation url field of the tree node put "javascript:process();"

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

    >
    >
     
    Mark Goldin, Jan 27, 2004
    #3
  4. Mark Goldin

    CMA Guest

    <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" <> wrote in message
    news:...
    > What is a name of that property?
    >
    > "CMA" <> wrote in message
    > news:#...
    > > in the navigation url field of the tree node put "javascript:process();"

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

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

    > >
    > >

    >
    >
     
    CMA, Jan 27, 2004
    #4
  5. Mark Goldin

    Mark Goldin Guest

    Thanks for all your help.

    "CMA" <> wrote in message
    news:#...
    > <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" <> wrote in message
    > news:...
    > > What is a name of that property?
    > >
    > > "CMA" <> wrote in message
    > > news:#...
    > > > in the navigation url field of the tree node put

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

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

    > >
    > >

    >
    >
     
    Mark Goldin, Jan 27, 2004
    #5
  6. Mark Goldin

    Mark Goldin Guest

    Is it possible to to send an atribute value thru NavigateUrl?
    Something like this:
    NavigateUrl="javascript:functionname(attributename);"

    "CMA" <> wrote in message
    news:#...
    > <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" <> wrote in message
    > news:...
    > > What is a name of that property?
    > >
    > > "CMA" <> wrote in message
    > > news:#...
    > > > in the navigation url field of the tree node put

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

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

    > >
    > >

    >
    >
     
    Mark Goldin, Jan 27, 2004
    #6
  7. Mark Goldin

    CMA Guest

    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
     
    CMA, Jan 27, 2004
    #7
  8. Mark Goldin

    Mark Goldin Guest

    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" <> wrote in message
    news:#...
    > 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
    >
    >
     
    Mark Goldin, Jan 27, 2004
    #8
  9. Mark Goldin

    CMA Guest

    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" <> wrote in message
    news:%...
    > 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" <> wrote in message
    > news:#...
    > > 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
    > >
    > >

    >
    >
     
    CMA, Jan 28, 2004
    #9
  10. Mark Goldin

    Mark Goldin Guest

    I meant since xml is loaded into the tree it would be possible to access it
    on the client.
    Is it all wrong?

    "CMA" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:%...
    > > 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" <> wrote in message
    > > news:#...
    > > > 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
    > > >
    > > >

    > >
    > >

    >
    >
     
    Mark Goldin, Jan 28, 2004
    #10
  11. Mark Goldin

    CMA Guest

    as to my knowledge it is not possible since it is creating the tree with
    your XML, but it is not giving the client the detailsof XML. after running
    the document check the source code of the page. the details in tree nodes u
    can access with clientside script. not the others..

    CMA


    "Mark Goldin" <> wrote in message
    news:%...
    > I meant since xml is loaded into the tree it would be possible to access

    it
    > on the client.
    > Is it all wrong?
    >
    > "CMA" <> wrote in message
    > news:...
    > > 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" <> wrote in message
    > > news:%...
    > > > 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" <> wrote in message
    > > > news:#...
    > > > > 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
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    CMA, Jan 28, 2004
    #11
  12. Mark Goldin

    Mark Goldin Guest

    If a node in the tree has NavigateUrl="javascript:test();"
    then the node is not getting highlighted when it's clicked.

    Can you explain, why?

    Thanks


    "CMA" <> wrote in message
    news:um#...
    > as to my knowledge it is not possible since it is creating the tree with
    > your XML, but it is not giving the client the detailsof XML. after running
    > the document check the source code of the page. the details in tree nodes

    u
    > can access with clientside script. not the others..
    >
    > CMA
    >
    >
    > "Mark Goldin" <> wrote in message
    > news:%...
    > > I meant since xml is loaded into the tree it would be possible to access

    > it
    > > on the client.
    > > Is it all wrong?
    > >
    > > "CMA" <> wrote in message
    > > news:...
    > > > 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" <> wrote in message
    > > > news:%...
    > > > > 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" <> wrote in message
    > > > > news:#...
    > > > > > 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
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Mark Goldin, Feb 3, 2004
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. wolf
    Replies:
    0
    Views:
    565
  2. Replies:
    0
    Views:
    1,586
  3. Tjerk Wolterink
    Replies:
    2
    Views:
    1,466
    Dimitre Novatchev
    Aug 24, 2006
  4. empriser
    Replies:
    1
    Views:
    650
    Ian Collins
    Mar 6, 2007
  5. chandrajit_in
    Replies:
    0
    Views:
    1,718
    chandrajit_in
    Jan 3, 2008
Loading...

Share This Page