亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

在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)文章

最新評(píng)論