Hi i am developing a page in which on selection of dropdownlist the Json method gets call.
Below is my dropdownlist event:
function onChange(e) {
alert(e.value);
var id = e.value;
//alert(e.val);
$.post("/SysAdmin/UsersRole/Get",
{
Id: id
},
function (data, status) {
alert(data);
});
}
I am calling Get method of UsersRole controller which will return List of tree element.
The code of controller
public List<Tree> Get(int Id)
{
RolesToUserViewModel viewModel = UsersRole.GetRoleByUser(Id);
return viewModel.Tree;
}
i am getting data in viewModel object but not able to access that data in JS function. How to access strongly typed object in JQuery?