Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# FindControl在GridView中不工作_C#_Asp.net - Fatal编程技术网

C# FindControl在GridView中不工作

C# FindControl在GridView中不工作,c#,asp.net,C#,Asp.net,void GridView1_RowCreated(对象发送方,GridViewRowEventArgs e) { 我无法让那个代码示例工作。 我需要访问页面上的超链接控件 我有母版页设置。请确保您使用的模板字段包含ID为=“linkDocs”的超链接 OnRowDataBound事件可能更适合您的需要。此超链接控件是在gridview行中,还是在页面本身的其他位置? if (e.Row.RowType == DataControlRowType.DataRow) {

void GridView1_RowCreated(对象发送方,GridViewRowEventArgs e) {

我无法让那个代码示例工作。 我需要访问页面上的超链接控件


我有母版页设置。

请确保您使用的模板字段包含ID为=“linkDocs”的超链接


OnRowDataBound事件可能更适合您的需要。

此超链接控件是在gridview行中,还是在页面本身的其他位置?
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        (e.Row.FindControl("linkDocs") as HyperLink).Visible = false;


    }

}