473,508 Members | 3,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Get a collection of page-names from your current project

I have a testproject with a number of pages. Here I want to build a Array
with all page-names(physical name & ID's). This array will be used to fill a
listbox/table/ something else.

QUESTION : How to get all pages within your project??
Nov 18 '05 #1
1 1112
You will need to use reflection for that. Here is a snippet of some code I
have written serving a different purpose.

bill

System.Reflection.Assembly ass = System.Reflection.Assembly.LoadFile(
@"C:\inetpub\wwwroot\test\bin\test.dll" );
Type baseType = null;
bool IsPage = false;
string pagename = null;
int badCount = 0;
foreach( Module mod in ass.GetModules() )
{
foreach( Type type in mod.GetTypes() )
{
IsPage = false;
baseType = type;
while ( baseType != typeof( object ) )
{
if ( baseType == typeof( dascweb.Pages.Page ) )
{
IsPage = true;
break;
}
baseType = baseType.BaseType;
}

if ( IsPage )
{
//add the baseType + ".aspx" to get the name of the page. This
is assuming that all your class names mirrors the name of the page
{
}
}
"Yi****@hotmail.com" <Yi****@hotmail.com@discussions.microsoft.com> wrote in
message news:6D**********************************@microsof t.com...
I have a testproject with a number of pages. Here I want to build a Array
with all page-names(physical name & ID's). This array will be used to fill a listbox/table/ something else.

QUESTION : How to get all pages within your project??

Nov 18 '05 #2

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

Similar topics

0
1901
by: Sundown | last post by:
I am trying to create a custom button control for the web that, when clicked, disables and changes the text of itself and a bunch of other controls (in the collection). My goal is to end up with a...
5
3550
by: mvr | last post by:
Hi all IIS 5.0, ASP, and https:// I have "DataEntrypage.asp" which is a data entry page(about 250 data elements includes text boxes, radio buttons, check boxes, drop down boxes etc). ...
1
1702
by: owyn | last post by:
One of my team memebers wants to pass a VB Collection to use as a pick list for a drop down box on an aspx page. I have to use C# for the code behind for the aspx page. I can not find a collection...
0
1111
by: Jeff Dockman | last post by:
Background: We needed the ability to create a templated web site that may change in layout from installation to installation. To accomplish this, we created a base Page class that all pages in...
0
244
by: Hazzard | last post by:
I am trying to figure out how to add an additional value to a querystring collection so that when I click on a datagrid cell, there will be a key to distinguish it from another column's...
2
1628
by: kermit | last post by:
I have a .net aspx page MyPage.aspx (client side) with code behind MyPage.aspx.vb (server side). I use the Page_Load event in MyPage.aspx.vb to load data into a multiteir class based...
2
3289
by: S. Justin Gengo | last post by:
Hi, I've created a component that allows me to store database information for various types of databases my company uses. It uses a collection for each type of database. Everything is working...
4
1748
by: Robert Schneider | last post by:
Hi, the msdn documentation provides an Dinosaurs example that uses the objectmodel.collection class. Just have a look on the help page for this class. I don't understand what happens here. Or...
6
3257
by: Steve | last post by:
I'm trying to iterate over all the form controls in my MasterPages content page. Basically, I've got dropdowns, textboxes, etc that I want to format in Page_Load() I've added this code to my...
11
3046
by: GG | last post by:
Anybody knows of any collection where is not stored in memory but using hard disk instead? Thanks *** Sent via Developersdex http://www.developersdex.com ***
0
7128
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7332
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7393
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
7502
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
5635
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,...
1
5057
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...
0
4715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.