Using colons with FindControl().

This is a nice undocumented feature. You can use colons inside specify string to find control within another control:

Control oControl = FindControl("MyGrid:_Ctl3:MyButton") ;

This line will return MyButton in row 0 (which get the random ID of _Ctl3).

(And you get ASP.NET methods to get row ID. E.g. UniqueID).

Actually ASP.NET uses this technique while dealing with PostBack.

5 Comments

Comments have been disabled for this content.