1
Answer

How to save selected tree view node id in action link

Photo of suman goud

suman goud

8y
299
1
How to save selected tree view node id in action link  using jquery
 i have tried
 
 
$(".treeview a").on("click", function () {
$.ajax({
url: '@Url.Action("GetTreeViewID", "Treeview", new { Eid=Model.FirstOrDefault().EmpID})'
});
});
 
am getting first treeview node id, if i remove firstofdefault am getting error 
 
but how to save selected node id in Eid 

Answers (1)

0
Photo of Venkatesan Arasappan
NA 1.1k 46.8k 8y
FirstOrDefault() will not throw an exception when there are no results or null.Its means in one your record might contain EmpID as Null