473,586 Members | 2,546 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 1121
You will need to use reflection for that. Here is a snippet of some code I
have written serving a different purpose.

bill

System.Reflecti on.Assembly ass = System.Reflecti on.Assembly.Loa dFile(
@"C:\inetpub\ww wroot\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.P age ) )
{
IsPage = true;
break;
}
baseType = baseType.BaseTy pe;
}

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@discussion s.microsoft.com > wrote in
message news:6D******** *************** ***********@mic rosoft.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
1917
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 button that prevents the user from submitting a form back multiple times and also prevents them from submitting the form and then clicking something...
5
3557
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). After the data validation through javascript(form.action = "ProcessData.asp" )I post this page to "ProcessData.asp" which process all
1
1706
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 object or any way to convert the collection to something that C# will use. I would like to hear any ideas on a solution for that. One idea I had...
0
1116
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 the site inherit from. In addition to providing basic functionality and security, this Page class modifies the HtmlForm controls collection in the...
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 functionality. I have Edit and Delete columns that each contain the ColumnID for the record I want to either edit, or delete. When I pull the item of the...
2
1632
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 collection. MyCollection(sYear).cMonths(sMonth).cDays(sDay).cEvents(sID).EventText My problem arrives when I try to access this collection from the...
2
3296
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 perfectly except when the component is deleted from the page. Here are the details. I add the component to the page from the toolbox and then add...
4
1751
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 I cannot find more detailed documentation for this behavior. What I mean is the invocation of the Dinosaurs.Add method which is derived from...
6
3264
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 Page_Load() event <code> private void ConfigureFormControls() { Color borderColor = ColorTranslator.FromHtml("#F5F5F5"); Color fontColor ...
11
3053
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
7841
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8339
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7965
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6617
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5712
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
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 we have to send another system
0
1184
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.