后台控制GridView中Itemtemplate中控件属性
1、foreach(GridViewRow gr in gridview1.Rows)
{
LinkButton l=gr.FindControls("LinkButton1") as LinkButton;
}
2、Visible='<%# GetVisible(Eval("id"))%>'
public bool GetVisible(object x){return true;};
3、
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { LinkButton cb = (LinkButton)this.GridView1.Rows[e.RowIndex].FindControl("LinkButton1"); }