I want to call a controller action method from .js file. But I am getting url as a string. It is not identifying this as a controller action method? How can we sort out this issue?
function updateBlockAsOrphan(invalidHandles) {
debugger;
console.log("updateBlockAsOrphan Started..................");
var url = '@Url.Action("updateBlockAsOrphan", "OpenDrawing", new { area = "Objects" })';
var paramswithcomma = invalidHandles.split(rowDelimeter).join(',');
var params = { BlockRefHandles: paramswithcomma };
console.log("updateBlockAsOrphan inprogress with data ..................");
$.ajax({
type: 'POST',
url: url,
data: params,
success: function (result)
{
debugger;
console.log("Result -" + result.d.length);
//console.log("REturned Value -" + result.d[0]);
//console.log("******************************Successhhh******************");
}
});
}