在web应用程序中,我试图在RowDataBound事件中查找网格控件。但它提供对象的实例的对象参考,这是我的代码:在gridview中查找控件?在Asp.net中?
protected void mygrid_RowDataBound(object sender, GridViewRowEventArgs e)
{
string empid = "";
empid = ((Label)e.Row .FindControl("lblname")).Text;
}
您可以传唤我找到控件,谢谢。
试试这个'标签lblprop_img_id =(标签)e.Row.Cells [2 ] .FindControl(“lblprop_img_id”);' – Murtaza 2012-01-12 09:36:41