This is what I do in the controller(It works fine) :
public JsonResult DepartmentList(string id)
{
JsonResult jr = new JsonResult();
var _menu = from a in DataContext.GetDepartment()
select new { ID = a.ID, Name = a.Name };
jr.Data = _menu.ToList();
jr.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
return jr;
}
And I want to use javascript to take the JSON that I have return in the below controller to display in a list and get the result :
<a href="blahblah.com/Products/dep=1?tab=2"> Department name1 </a>
<a href="blahblah.com/Products/dep=2?tab=2"> Department name2 </a>
....
Thanks.