public JsonResult LoadProjectsByTaskId(int taskId) { var query = from tasks in context.Tasks join projects in context.Projects on tasks.ProjectId equals projects.ProjectId select new { tasks, projects }; return Json(query, JsonRequestBehavior.AllowGet); }
function LoadProjectsByTaskId() { $("#textarea").autocomplete({ source: function (request, response) { debugger; $.ajax({ url: "/Home/LoadProjectsByTaskId", type: "POST", dataType: "json", data: { term: request.term }, success: function (data) { { response($.map(data, function (item) { return { label: item.Name, value: item.Name }; })) } }, }); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)