ASP.NET Repeater、Gridview行序号
如果在ASP.NET中应用了Repeater、Gridview,想获取到行的序号,很简单,使用Container.ItemIndex即可。
在Gridview中使用<%# Container.DataItemIndex %>取得当前行的序号
而在Repeater控件中使用Container.ItemIndex取得当前行的序号,主要格式, Container.ItemIndex 用于绑定中的。
如果在ASP.NET中应用了Repeater、Gridview,想获取到行的序号,很简单,使用Container.ItemIndex即可。
在Gridview中使用<%# Container.DataItemIndex %>取得当前行的序号
而在Repeater控件中使用Container.ItemIndex取得当前行的序号,主要格式, Container.ItemIndex 用于绑定中的。