【发布时间】:2015-11-07 13:09:00
【问题描述】:
我一直通过 ELMAH 收到此错误。即使程序完成了它的预期操作,我仍然通过 ELMAH 收到此错误,我想知道原因并修复它。我已经浏览了其他线程并尝试使用这些建议,但到目前为止我读过的任何内容似乎都不起作用。
它的预期操作是创建一个 excel 文档,然后将用户重定向到他们刚才所在的页面。
动作结果:
public ActionResult ExportClaimNumberReport(int ClientID, string ClaimNo) {
ClaimNumberViewModel model = ClaimNumberReport(ClientID, ClaimNo);
CreateExcelFile.CreateExcelDocument(
model.ReportData.ToList(),
model.ReportDescription + (".xlsx"),
HttpContext.ApplicationInstance.Response);
ViewBag.client = client;
Response.Buffer = true;
Response.Redirect(Request.UrlReferrer.ToString());
if (!Response.IsRequestBeingRedirected) {
Response.Redirect("/Error/ErrorHandler");
}
return RedirectToAction("ErrorHandler", "Error");
}
如果您需要更多信息,请告诉我
【问题讨论】:
标签: c# asp.net-mvc error-handling