Reputation: 11725
I have the following in my controller:
ViewBag.ProjectID = ID;
How can retrive the projectID in the following in javascript?
$.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
url: "@Url.Action("Delete")",
data:
{
***projectID : $("#ProjectID").val()***
},
Upvotes: 0
Views: 1564
Reputation: 16184
data: { 'projectID' : '@ViewBag.ProjectID' }
Should do the trick.
Upvotes: 0