我有一个.Net 4.0 MVC 4.0项目。我在日志表中多次跟踪两个错误。
404_System.Web.HttpException (0x80004005): The controller for path '/Scripts/jquery.validate.unobtrusive' was not found or does not implement IController.
404_System.Web.HttpException (0x80004005): The controller for path '/UpdateAccrual' was not found or does not implement IController.
以下是我的Global.Asax文件。
protected void Application_Error(object sender, EventArgs e)
{
var error = Server.GetLastError();
RouteData routeData = new RouteData();
routeData.Values.Add("controller", "Error");
routeData.Values.Add("action", "Index");
string logDescription = Convert.ToString(error);
var errorCode = (error is HttpException) ? (error as HttpException).GetHttpCode() : 0;
if (errorCode != 0)
{
logDescription = errorCode + "_"+logDescription;
}
ErrorLogBL.InsertLog(1, 1, UIConstants.LogName, logDescription, AppContext.CurrentUser.EffectiveUserID);
IController errorController = new ErrorController();
errorController.Execute(new RequestContext(new HttpContextWrapper(Context), routeData));
Response.End();
}
注意:有一个UpdateAccrual控制器。
注意:我不介意不引人注意的错误。但UpdateAccrual控制器导致系统导航到错误视图。
问题
Response.End()
routing
?