欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

在RowCommand事件中獲取索引值示例代碼

 更新時(shí)間:2014年06月13日 15:26:40   投稿:whsnow  
這篇文章主要介紹了如何在RowCommand事件中獲取索引值,需要的朋友可以參考下
在RowCommand事件中獲取索引值

1.利用e.CommandSource
復(fù)制代碼 代碼如下:

protected void lpg_RowCommand(object sender, GridViewCommandEventArgs e)

{

if (e.CommandName == "ItemCollect")
{
GridViewRow gvr = (GridViewRow)(((LinkButton)(e.CommandSource)).NamingContainer);
LinkButton lk = lpgKnowledgeExchange.Rows[gvr.RowIndex].FindControl("lbtnCollect") as LinkButton;

}

}

2.如果是模板列中的button直接click事件

利用sender 取其parent 也可以實(shí)現(xiàn)

相關(guān)文章

最新評論