views:

24

answers:

0

I have a CommonMaster page that then contains a ConfigurableReportsMaster page. I then have an AutitLog.aspx page. Now, on that .aspx page I have multiple UserControls. Some of these UserControls are inheriting from an ISQLFilter interface, but not all.

While on the .aspx, in a RunReport event (that currently successfully fires) I am manually calling a method of each UserControl (that is in the ISQLFilter interface) called .GetWhereClause().

this.ucsStateFilter.GetWhereClause(ref sbWhere);
this.ucsStatusFilter.GetWhereClause(ref sbWhere);
this.ucsActivityType.GetWhereClause(ref sbWhere);
this.ucsVendorFilter.GetWhereClause(ref sbWhere);
this.ucsProducerFilter.GetWhereClause(ref sbWhere);
this.ucsNameFilter.GetWhereClause(ref sbWhere);
this.ucsPolicyFilter.GetWhereClause(ref sbWhere);
this.ucsShowAddressInfo.GetWhereClause(ref sbWhere);

This works great and does exactly what I need. I would like though, for ease of use, is to just call one method, say GetAllWhereClauses() that would use Reflection to find all of the UserControls (that inherit the ISQLFilter interface.) It sounds really simple and I have used reflection numerous times. I would assume I could have just done:

Type t = typeof(AuditLog);
PropertyInfo[] pis = t.GetProperties();

But the UserControls are not there. I can look at this in the QuickWatch window and see each of my UserControls. I have tried a looping through each of the .Controls sets from the Page and deeper and I can successfully get to controls that I have on the CommonMaster page. But that doesn't help me here.

Perhaps I am thinking too much about it. If it would help, can I just get a list of all of the "<%@ Register ... %> items? I suspect I am just missing one cast or something.

Thanks in advance, Kevin