Reputation: 9737
onSelectRow: function(id) {
document.location.href = '@Url.Action("EditEncounter", "EditEncounter", new { encounterId = "'<%:id%>'", popId = TempData["POPULATIONID"] })'
//new { encounterId = temp.EncounterId, popId = (int)TempData["POPULATIONID"] }
}
How in sam hill do I get that id variable into my Url.Action method?
This is what I am looking at when I debugg
document.location.href = '/EditEncounter/EditEncounter?encounterId=%40id&popId=2'
Upvotes: 4
Views: 3770
Reputation: 9737
var dummyURL ='@Url.Action("EditEncounter", "EditEncounter", new { encounterId = -2, popId = TempData["POPULATIONID"] })';
var path =dummyURL.replace("-2", id);
debugger;
document.location.href = path;
That appears to work.
Upvotes: 4