我想从.js文件中调用控制器操作方法。但我得到的URL是一个字符串。它没有将此识别为控制器动作方法?我们如何解决这个问题?
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******************");
}
});
}