FindControl
is not recursive, it only searches through immediate children of the controlFindControl(String, int)
which is not indented for public usageFindControl
returns null
, so this is often a good idea to verify result for being not null
TextBox txt = (TextBox)FindControl(yourtxt_Id);
If the Control has rows.
TextBox tb = GridView1.Rows[i].FindControl("TextBox1") as TextBox;
Or if it has items.
TextBox tb = Repeater1.Items[i].FindControl("TextBox1") as TextBox;
control.FindControl("Id Of The Control To Be Found")