0

我有一个 .Net 4.0 MVC 4.0 项目。我在日志表中多次出现以下两个错误。

  1. 404_System.Web.HttpException (0x80004005): The controller for path '/Scripts/jquery.validate.unobtrusive' was not found or does not implement IController.
  2. 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 控制器导致系统导航到错误视图。

问题

  1. 是不是因为误用Response.End()
  2. 还是由于任何问题routing
4

0 回答 0