473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

List of Pages

Can I programatically get a list of Pages that are part of an ASP.NET
assembly ?
Nov 18 '05 #1
6 1100
"JezB" <je***********@blueyonder.co.uk> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Can I programatically get a list of Pages that are part of an ASP.NET
assembly ?


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.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #2
"JezB" <je***********@blueyonder.co.uk> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Can I programatically get a list of Pages that are part of an ASP.NET
assembly ?


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.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #3
I could indeed, good idea. I'll give it a try.

"John Saunders" <jo**************@notcoldmail.com> wrote in message
news:Of**************@tk2msftngp13.phx.gbl...
"JezB" <je***********@blueyonder.co.uk> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Can I programatically get a list of Pages that are part of an ASP.NET
assembly ?
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.
--
John Saunders
johnwsaundersiii at hotmail

Nov 18 '05 #4
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;
}

"JezB" <je***********@blueyonder.co.uk> wrote in message
news:OL**************@TK2MSFTNGP12.phx.gbl...
I could indeed, good idea. I'll give it a try.

"John Saunders" <jo**************@notcoldmail.com> wrote in message
news:Of**************@tk2msftngp13.phx.gbl...
"JezB" <je***********@blueyonder.co.uk> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Can I programatically get a list of Pages that are part of an ASP.NET
assembly ?


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.
--
John Saunders
johnwsaundersiii at hotmail


Nov 18 '05 #5
"JezB" <je***********@blueyonder.co.uk> wrote in message
news:eN**************@TK2MSFTNGP09.phx.gbl...
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;
}
I think that tt.IsSubClassOf(typeof(System.Web.UI.Page)) would work better.
Yours will pick up my own type called "Page".
--
John Saunders
johnwsaundersiii at hotmail

"JezB" <je***********@blueyonder.co.uk> wrote in message
news:OL**************@TK2MSFTNGP12.phx.gbl...
I could indeed, good idea. I'll give it a try.

"John Saunders" <jo**************@notcoldmail.com> wrote in message
news:Of**************@tk2msftngp13.phx.gbl...
"JezB" <je***********@blueyonder.co.uk> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
> Can I programatically get a list of Pages that are part of an ASP.NET > assembly ?

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.
--
John Saunders
johnwsaundersiii at hotmail



Nov 18 '05 #6
Yes, that's cleaner - thank you.
(IsSubclassOf)

"John Saunders" <jo**************@notcoldmail.com> wrote in message
news:uk****************@TK2MSFTNGP12.phx.gbl...
"JezB" <je***********@blueyonder.co.uk> wrote in message
news:eN**************@TK2MSFTNGP09.phx.gbl...
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;
}
I think that tt.IsSubClassOf(typeof(System.Web.UI.Page)) would work

better. Yours will pick up my own type called "Page".
--
John Saunders
johnwsaundersiii at hotmail

"JezB" <je***********@blueyonder.co.uk> wrote in message
news:OL**************@TK2MSFTNGP12.phx.gbl...
I could indeed, good idea. I'll give it a try.

"John Saunders" <jo**************@notcoldmail.com> wrote in message
news:Of**************@tk2msftngp13.phx.gbl...
> "JezB" <je***********@blueyonder.co.uk> wrote in message
> news:%2****************@TK2MSFTNGP11.phx.gbl...
> > Can I programatically get a list of Pages that are part of an ASP.NET > > assembly ?
>
> 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.
> --
> John Saunders
> johnwsaundersiii at hotmail
>
>



Nov 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Nicolas Girard | last post by:
Hi, Forgive me if the answer is trivial, but could you tell me how to achieve the following: {k1:,k2:v3,...} --> ,,,...] The subtle point (at least to me) is to "flatten" values that are...
2
by: Bart Plessers \(artabel\) | last post by:
Hello, I am developping a web-based file browser. Everything so far so good right now. To make the userinterface more conveniant, I want to split my file list in pages. with Set oFSO =...
16
by: Shwetabh | last post by:
Hi, This is a question asked to me in an interview. I haven't been able to figure out an answer for it. Please try to see what can be done about the following problem. /* I have been given two...
7
by: Brian | last post by:
First off, I am sorry for cluttering this group with my inept questions, but I am stuck again despite a few hours of hair pulling. I have a function (below) that takes a list of html pages that...
9
by: hurricane51 | last post by:
I've created a navigation menu list with CSS, and it works fine. However, on every web pages that it appears, I have to add the same content, e.g.: <div id="navcontainer"> <ul id="navlist">...
0
bartonc
by: bartonc | last post by:
Examples of wx.Wizard that I found used explicit names for the pages. Using eval() in a list comprehension, I am able to go through the imported modules by name and call create() in order to get a...
1
by: David Bilsby | last post by:
All Apologies for cross posing this but I am not sure if this is a VC 8 STL bug or simply an invalid use of the iterator. I have a PCI card access class which basically abstracts a third party...
7
by: Steve K | last post by:
First problem: I am specifying a format string for a Binding object like so: <code> Binding binding = new Binding("Text", item.EOBRemittance, "AmountAllowed", true, DataSourceUpdateMode.Never,...
0
by: mandalorian2 | last post by:
I wrote some C# functions that output a List of System.Drawing.Graphics (List<System.Drawing.Graphics>) objects. they then return the List to a PrintDocument object which I want to have print out...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.