前台绑定时:CommandArgument=<%#((GridViewRow) Container).RowIndex %>
后台获取索引:int rowIndex = Convert.ToInt32(e.CommandArgument);
这样可以在RowCommand方法里获取到RowIndex.
本文详细介绍了如何在ASP.NET中通过CommandArgument和CommandArgument获取GridView的当前行索引,以便在RowCommand事件中进行操作。
前台绑定时:CommandArgument=<%#((GridViewRow) Container).RowIndex %>
后台获取索引:int rowIndex = Convert.ToInt32(e.CommandArgument);
这样可以在RowCommand方法里获取到RowIndex.
3560

被折叠的 条评论
为什么被折叠?