我有一个返回 json ContentResult 的方法。我从这样的 JavaScript 文件中调用:
$scope.GetUserRoles = function () {
$http({
method: "GET",
url: Current.VirtualUrl + "Store/Counting/GetUserRoles"
}).then(function mySucces(response) {
if (response.data.Status == 1) {
$scope.UserRoles = response.data.Data;
$scope.GetCountingList(0, false, "CountingId", "DESC");
}
else {
console.log(response);
$scope.ShowMessage(msgWarning, msgDataFromServerFail + response.data.Data);
}
}, function myError(response) {
});
}
当在这里调用GetUserRoles 方法时不会触发并且 Response.Data 得到这个错误:
<link href="/MySite/Assets/css/pages/error.css" rel="stylesheet" />
<div class="page-500-full-page">
<div class="row">
<div class="col-md-12 page-500">
<div class=" number">
500
</div>
<div>
<h3>Oops! Something went wrong.</h3>
<p>
The view 'GetUserRoles' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Areas/iStore/Views/Counting/GetUserRoles.aspx
~/Areas/iStore/Views/Counting/GetUserRoles.ascx
~/Areas/iStore/Views/Shared/GetUserRoles.aspx
~/Areas/iStore/Views/Shared/GetUserRoles.ascx
~/Views/Counting/GetUserRoles.aspx
~/Views/Counting/GetUserRoles.ascx
~/Views/Shared/GetUserRoles.aspx
~/Views/Shared/GetUserRoles.ascx
~/Areas/iStore/Views/Counting/GetUserRoles.cshtml
~/Areas/iStore/Views/Counting/GetUserRoles.vbhtml
~/Areas/iStore/Views/Shared/GetUserRoles.cshtml
~/Areas/iStore/Views/Shared/GetUserRoles.vbhtml
~/Views/Counting/GetUserRoles.cshtml
~/Views/Counting/GetUserRoles.vbhtml
~/Views/Shared/GetUserRoles.cshtml
~/Views/Shared/GetUserRoles.vbhtml </p>
</div>
</div>
</div>
</div>
任何帮助都感激不尽。
提前致谢。