calling OnClientNodeClicked function from server side

2 posts, 0 answers
  1. Sean
    Sean avatar
    3 posts
    Member since:
    Feb 2011

    Posted 17 Sep 2012 Link to this post

    I have a client function for OnClientNodeClicked  
       function NodeClicked (sender, args)

    i use this function to calculate how many checked nodes.
    Now, i am doing something on server side and do not want to write the same function on server side again. Is there a way i can call  NodeClicked (sender, args)  function from server side ?

    thanks for helping

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 18 Sep 2012 Link to this post

    Hi Sean,

    I suppose you want to call a NodeClicked function in the code behind. Try the following code snippet to achieve your scenario.

    string script = "<script language='javascript'>function f(){OnClientNodeClicked(" + treeView + "," + Node + "); Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</script>";
    Page.ClientScript.RegisterStartupScript(this.GetType(), "Pass", script);

    <script type="text/javascript">
        function OnClientNodeClicked(sender, args) {
           // Your Code

    Please elaborate your scenario if it doesn't helps.

Back to Top