Tag: viewdata

哎呀! 为什么System.Web.Mvc.HandleErrorInfo会传递给我的视图?

我遇到了一个相当令人沮丧的问题。 我的MVC网站大部分运行正常,但随机抛出一个错误(向用户显示一个友好的错误)。 当我检查日志时,这就是我得到的: System.InvalidOperationException: The model item passed into the dictionary is of type ‘System.Web.Mvc.HandleErrorInfo’ but this dictionary requires a model item of type ‘BaseViewData’. 片刻之后,同一个用户可以点击刷新并且页面加载正常。 我被卡住了。 ( 更新:添加堆栈跟踪 System.Web.HttpUnhandledException: Exception of type ‘System.Web.HttpUnhandledException’ was thrown. —> System.InvalidOperationException: The model item passed into the dictionary is of type ‘System.Web.Mvc.HandleErrorInfo’ but this dictionary requires a model […]