J
JezB
Can I programatically get a list of Pages that are part of an ASP.NET
assembly ?
assembly ?
JezB said:Can I programatically get a list of Pages that are part of an ASP.NET
assembly ?
John Saunders said:You could use Reflection to iterate through all the classes in the assembly
and then look at those which derive from System.Web.UI.Page.
JezB said:For the record:
private ArrayList GetPages(Assembly a)
{
ArrayList pages = new ArrayList();
foreach (Type tt in a.GetTypes())
{
if (tt.BaseType.Name == "Page")
pages.Add(tt.Name);
}
return pages;
}
John Saunders said:I think that tt.IsSubClassOf(typeof(System.Web.UI.Page)) would work better.
Yours will pick up my own type called "Page".