[英]Cannot figure out Client Error
In an ASP.NET Angular Application, I have a particular method I am calling through angularJS to display some data from the database, but doing so, I get an error that states " An Error has occurred . Error detailed not Sent by the server." 在ASP.NET Angular应用程序中,我有一个特定的方法,我要通过angularJS调用该方法以显示数据库中的某些数据,但这样做时,我收到一条错误消息,指出“ 发生了错误。服务器未发送详细错误信息。 ” I confirmed it by debugging the method and discovered it works just fine and retrieves the data, but when it's time to display on the client, this happens.
我通过调试该方法进行了确认,发现它可以正常工作并检索数据,但是当需要在客户端上显示时,就会发生这种情况。 I have opened the browser console to check what is happening, but the error is not logged there either.
我已经打开浏览器控制台来检查发生了什么,但是该错误也未记录在该控制台中。 If Only I can know what the problem is exactly, it would be so much better.
如果只有我能知道问题出在哪里,那就好得多了。 See my code below;
请参阅下面的代码;
C# C#
public async Task<ListResultDto<GoodsRequestDto>> GetGoodsRequests()
{
var goodsRequests = await _goodsRequestRepo.GetAllListAsync();
return new ListResultDto<GoodsRequestDto>(
goodsRequests.MapTo<List<GoodsRequestDto>>()
);
}
AngularJS AngularJS
vm.loadGoodsRequests = function () {
projectService.getGoodsRequests({}).success(function (result) {
vm.goodsRequests = result.items;
});
}
The HTML HTML
<div ng-if="vm.goodsRequests.length" ng-repeat="gr in vm.goodsRequests" class="classInfo-list-item col-md-6">
<div class="classInfo-body">
<h3 class="classInfo-title">
{{gr.categoryItem.name + "_" + gr.brand.name + "_" + gr.product.name | cut:true:50:' ...'}}
</h3>
<p class="classInfo-description">Quantity: {{gr.quantity}} {{gr.unit}}</p>
<p class="classInfo-description">Payment Term: {{gr.paymentTerm}}</p>
<div class="classInfo-registration-info">
{{gr.goodsQuotes.length}} Quote(s).
</div>
<div class="classInfo-actions">
<a class="btn btn-sm btn-info" ng-href="#/my-goods-requests/{{gr.id}}">@L("Details") <i class="fa fa-arrow-circle-right"></i></a>
</div>
<span ng-class="vm.statusClass(gr.statusString)" class="classInfo-date"> {{gr.statusString }}</span>
</div>
</div>
I used similar approach for other pages of the application and I didn't get any such problem. 我对应用程序的其他页面使用了类似的方法,但是没有遇到任何此类问题。 I don't know what I'm doing wrong and worst of all, I don't know the exact cause of the error.
我不知道我在做什么错,最糟糕的是,我不知道错误的确切原因。
If your'e using the ASP.NET boilerplate , you can see the logs from "/host/maintenance" . 如果您使用的是ASP.NET样板 ,则可以从“ / host / maintenance”查看日志。 In this case you need to log in with the host admin.
在这种情况下,您需要以主机管理员身份登录。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.