【发布时间】:2011-09-23 14:31:46
【问题描述】:
我正在尝试在 Application_Error 中进行全局级别的自定义错误处理。
Exception ex = Server.GetLastError();
Server.ClearError();
AssortmentDefinitionLogManager.LogException(ex);
Context.RewritePath("/Error/Error");
IHttpHandler httpHandler = new MvcHttpHandler();
httpHandler.ProcessRequest(Context);
但我得到了这个错误
Error Message - The view '~/Views/Shared/Error' or its master was not found or no view engine supports the searched locations.
我也试过了
var urlHelper = new UrlHelper(HttpContext.Current.Request.RequestContext);
var redirectUrl = urlHelper.Action("Error", "Error");
Response.Redirect(redirectUrl);
【问题讨论】:
-
在~/Views/Shared/或~/Views/Error/目录下是否存在视图“Error”?
标签: asp.net-mvc-3 application-error