asp.net中DataGrid利用RenderControl导出Excel的问题

问题:

"DataGridLinkButton"的控件“DataGrid1_ctl14_ctl1“必须放在具有runat=server的窗体标记内。

原因:

DataGrid分页显示,RenderControl导出前需要先将分页取消

解决方案:

1、AllowPaging属性为Flase;

2、重新绑定Grid

原文地址:https://www.cnblogs.com/loge/p/3057064.html