从代码隐藏到aspx页面发送列表数据时出现ASP.NET错误

时间:2017-05-05 18:14:55

标签: c# asp.net stack-overflow code-behind

我在StackOverflowException中获得Page_Load,该网站将永远加载一个空白页面并显示此错误。

enter image description here

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

您从places属性返回places属性,溢出堆栈。将您的财产更改为:

protected List<Place> Places { get; set; }

在Page_Load:

Places = new List<Place> { ... };