简体   繁体   English

将列表数据从后台代码发送到ASPX页面时出现ASP.NET错误

[英]ASP.NET Error when sending a list data from code-behind to aspx page

I get StackOverflowException in Page_Load , The website is loading forever with a blank page and this error appears.: 我在Page_Load得到StackOverflowException ,该网站将永远加载空白页,并且出现此错误。

在此处输入图片说明

How can I solve this? 我该如何解决?

You return places property from places property, overflowing your stack. 您从places属性返回places属性,从而places堆栈溢出。 Change your property to: 将您的属性更改为:

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

And in Page_Load: 在Page_Load中:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM