在执行当前Web请求期间发生了未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。 [英] An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
本文介绍了在执行当前Web请求期间发生了未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
System.NullReferenceException: Object reference not set to an instance of an object.
我尝试了什么:
What I have tried:
Line 122:
Line 123: Select Class
Line 124: @foreach (var item in Model.ClassList)
Line 125: {
Line 126: @item.ClassName
Source File: F:\Education_SD\CMS\CODE\CMS.Institute\Views\Report\StudentAttendanceReport.cshtml Line: 124
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
ASP._Page_Views_Report_StudentAttendanceReport_cshtml.Execute() in
推荐答案
问题在于 foreach 无法迭代ull变量,在你的情况下 Model.ClassList
为null ...
The problem is that foreach can not iterate a null variable, and in your case Model.ClassList
is null...
这篇关于在执行当前Web请求期间发生了未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文