Can Any body help on this From View: <pre>@Html.ActionLink("Details", "", new { id = item.id }, new { onclick = "someFunction(" + item.id + ")", href = "javascript:void(0)" })
function someFunction(id) { $.ajax({ type: 'POST', url: '@Url.Content("~/")Contracts/Test/', data: { 'id': id }, dataType: 'json', success: function (data) { alert(data.domain_name); }, error: function (xhr, status, exception) { alert("Error: " + exception + ", Status: " + status); } });
public JsonResult Test(int id) { var result = (from cntrct in db.contracts where cntrct.id == id select new { cntrct.domain_name, cntrct.id}).ToArray(); return Json(result); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)