This is a migrated thread and some comments may be shown as answers.

[Solved] make a ajax call from treeview node

2 Answers 99 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
sefer kılıç
Top achievements
Rank 1
sefer kılıç asked on 26 Mar 2010, 09:39 AM
I want to make a ajax call from treeview nodes like Ajax.ActionLink(....) method.

have any idea how I can do this. 

thank you

2 Answers, 1 is accepted

Sort by
0
Evgenuy
Top achievements
Rank 1
answered on 28 Mar 2010, 09:51 PM
it's simple:

.ClientEvents(
events => events.OnSelect("onSelect")) 
 
 
//-------------------------------------------------------- 
 
                     <script type="text/javascript"> 
                         function onSelect(obj) { 
                             var item = $(obj.item); 
 
                             $.ajax( 
                            { 
                                type: "POST", 
                                url: "/Controller/Action", 
                                data: "Id=" + item.closest('.t-item').find(':input[name*="Value"]').val(), 
                                success: function (result) { 
                                  //Do some 
                                } 
                            }); 
                         } 
                    </script> 

0
sefer kılıç
Top achievements
Rank 1
answered on 29 Mar 2010, 07:48 AM
thank you for your answer.

Best Regards..
Tags
TreeView
Asked by
sefer kılıç
Top achievements
Rank 1
Answers by
Evgenuy
Top achievements
Rank 1
sefer kılıç
Top achievements
Rank 1
Share this question
or