I pass the parameters @ Url.Action as follows:
function showHistory() { myId= $("#id").val(); //alert(myId); actionDialog.load("@Url.Action("ActionHistoryAjax", new {id = myId, sort = "abc"})", function () { actionDialog.dialog('open'); }); }
But it gives an error "the name myId does not exist in the current context".
How can I pass a variable?
I solved this, this solution:
function showHistory() { myId= $("#id").val(); //alert(myId); actionDialog.load("@Url.Action("ActionHistoryAjax", new {id = "_Id", sort = "abc"})".replace("_Id", DeviceID), function () { actionDialog.dialog('open'); }); }
source share