How to call a server side method from Javascript when clicking on the checkbox of RTV

4 posts, 0 answers
  1. nikila
    nikila avatar
    5 posts
    Member since:
    Dec 2008

    Posted 16 Dec 2008 Link to this post

    I have a Radtreeview with checkboxes. I would like to check the checkbox it should not do a postback.
    So i used the OnClientNodeChecked, But on the OnClientNodeChecked i would like to fire a server side method....
    Can you clarify how i can achieve this. My page is AJAX Enabled.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 Dec 2008 Link to this post

    Hi Nikhila,

    You can perform a PostBack from the OnClientNodeChecked client event as shwon below.

    JS:
     
    <script type="text/javascript">  
      
    function OnClientNodeChecked()  
    {  
    alert("Perform PostBack?")  
     __doPostBack('RadTreeView1.ClientID')  
    }  
    </script>  



    Shinu
  3. nikila
    nikila avatar
    5 posts
    Member since:
    Dec 2008

    Posted 17 Dec 2008 Link to this post

    I was trying to implement the suggestion, But the problem is that i have written a specific function name OnCheck and I would like to call a specific method in the sever side. Can u help me how to get it done.
  4. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 17 Dec 2008 Link to this post

    Hi nikila,

    You could use RadAjaxManager and its ajaxRequest client-side method. It would fire the AjaxRequest server side event. You can find more info here.

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top