在FooterTemplate 里面放个Panel 值为“提示信息文本”设置Visible为flase 然后在ItemDataBound下写
if (e.Item.ItemType==ListItemType.Footer)
{
if (DataList1.Items.Count == 0)//显示的数据项为0 既是没有数据
{
((Panel)e.Item.FindControl("Panel_Noting")).Visible = true;
}
}
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)