在转发器 rpt_ItemCommand
事件中,e.Item.DataItem
始终为 null。
这是背后的代码:
protected void rpt_ItemCommand(Object sender, RepeaterCommandEventArgs e)
{
DataRowView drv = (DataRowView)e.Item.DataItem // here the DataItem is Null.
}
向我提出任何解决方案。
最佳答案
DataItem 属性始终为 null,但 ItemDataBound 除外...这是 Microsoft 设计的。
关于Asp.Net Repeater ItemCommand 数据项始终为 null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17781203/