GridView.RowDataBound、 Repeater.ItemDataBound 绑定时加入的判断语句

GridView.RowDataBound 加入 

e.Row.RowType == DataControlRowType.DataRow

详见:http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.gridview.rowdatabound%28v=VS.80%29.aspx

 

Repeater.ItemDataBound  加入

e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem

详见:http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.repeater.itemdatabound(VS.80).aspx

posted @ 2011-11-03 18:09  顿金  阅读(124)  评论(0编辑  收藏  举报