views:

19

answers:

1

Hi all,

I want to get all of the controls in my current aspx page and see which ones are of a certain type and then add them to a collection.

I can accomplish this and have written some test code that will process everything in this.controls and the child controls of those. This seems to work ok but it ends up having to process the entire page controls when really I'm only really wanting to know about the ones in the scope of the current aspx (eg. ignoring the master page), essentially I want to dynamically get a list of the controls that appear in the designer for the page and only iterate through those ones to find out which are of a certain type.

Is this possible, im guessing I might have to use reflections somehow as this.Controls includes the controls of everything on the entire page (not just the controls I see declared in the aspx designer file).

Cheers