
尝试这个:
foreach(GridViewRow row in GridView1.Rows) { if(row.RowType == DataControlRowType.DataRow) { Hyperlink myHyperlink = row.FindControl("myHyperlinkID") as Hyperlink; }}如果要处理RowDataBound事件,则如下所示:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e){ if(e.Row.RowType == DataControlRowType.DataRow) { Hyperlink myHyperlink = e.Row.FindControl("myHyperlinkID") as Hyperlink; }}欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)