I have a complex asp.net form,having even 50 to 60 fields in one form like there is Multiview
, inside MultiView I have a GridView
, and inside GridView I have several CheckBoxes
.
Currently I am using chaining of the FindControl()
method and retrieving the child ID.
Now, my question is that is there any other way/solution to find the nested control in ASP.NET.
If you're looking for a specific type of control you could use a recursive loop like this one - http://weblogs.asp.net/eporter/archive/2007/02/24/asp-net-findcontrol-recursive-with-generics.aspx
Here's an example I made that returns all controls of the given type
Late as usual. If anyone is still interested in this there are a number of related SO questions and answers. My version of recursive extension method for resolving this: