I'm working on ASP.NET MVC , My application is to display list of menues in list box and when you click on any items another view will display list of submenues , and I have a problem is how to return Json to another view in the first of all the controller return view model object to view to display it on list box like the following
return View(data);
where data is array of Strings , and I add an event to list box when selecting some item
@Html.Orubase().ListBox("list").RenderMode(RenderMode.Auto).IOS(c => c.ShowCorners(false)).BindDataSource(Model, map =>
{
map.MapTo<string>(binding =>
{
binding.ItemDataBound((item, nd) =>
{
item.Text = nd;
});
});
}).OnItemSelect("select")
Where select is javascript function that call another function in controller
function select(event, d) {
var index = d.selectedItemIndex;
$.ajax({
url: '@Url.Action("GetSubMenue", "Home")',
type: 'GET',
dataType: 'json',
data:{ind:index},
cache: false,
success: function (data) {
}
});
Now GetSubMenue function will return the following object "data" that is another array of string
return Json(data,JsonRequestBehavior.AllowGet);
now I want GetSubMenue function to return Json data object to another view to view it in a new list so, can you help me please