473,401 Members | 2,125 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,401 software developers and data experts.

Programatically find the pages in a project

Can anyone help out on this one?

i would like to find out all the ASPX and ASCX pages that are in my project,
and return them in an arraylist.

thanks,
Paul.
Nov 18 '05 #1
4 1328
You would have to load the assembly, and using reflection go through each
class to see if it inherits from Page or UserControl. If it does, add it to
your list of class names.

"Milsnips" <mi******@hotmail.com> wrote in message
news:es**************@TK2MSFTNGP11.phx.gbl...
Can anyone help out on this one?

i would like to find out all the ASPX and ASCX pages that are in my project, and return them in an arraylist.

thanks,
Paul.

Nov 18 '05 #2
Well, you could recursively loop through the directory structure looking for
said files. something like:

Public Sub GetFiles(ByVal path As String, ByVal extension As String, ByVal
files As ArrayList)
For Each file As String In System.IO.Directory.GetFiles(path, extension)
files.Add(file)
Next
For Each directory As String In System.IO.Directory.GetDirectories(path)
GetFiles(directory, extension, files)
Next
End Sub

and you can use it via:

Dim files As New ArrayList
GetFiles(Server.MapPath("~"), "*.aspx", files)
Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Milsnips" <mi******@hotmail.com> wrote in message
news:es**************@TK2MSFTNGP11.phx.gbl...
Can anyone help out on this one?

i would like to find out all the ASPX and ASCX pages that are in my project, and return them in an arraylist.

thanks,
Paul.

Nov 18 '05 #3
thanks for the info,

how do i actually reference the assembly name/string in the assembly.Load
function? is it the DLL name?

regards,
Paul.

"Marina" <so*****@nospam.com> wrote in message
news:Os**************@tk2msftngp13.phx.gbl...
You would have to load the assembly, and using reflection go through each
class to see if it inherits from Page or UserControl. If it does, add it to your list of class names.

"Milsnips" <mi******@hotmail.com> wrote in message
news:es**************@TK2MSFTNGP11.phx.gbl...
Can anyone help out on this one?

i would like to find out all the ASPX and ASCX pages that are in my

project,
and return them in an arraylist.

thanks,
Paul.


Nov 18 '05 #4
It depends on where that DLL is, etc. Look at the Assembly class's load
method that can load a specified assembly into memory.

"Milsnips" <mi******@hotmail.com> wrote in message
news:ek****************@TK2MSFTNGP12.phx.gbl...
thanks for the info,

how do i actually reference the assembly name/string in the assembly.Load
function? is it the DLL name?

regards,
Paul.

"Marina" <so*****@nospam.com> wrote in message
news:Os**************@tk2msftngp13.phx.gbl...
You would have to load the assembly, and using reflection go through each class to see if it inherits from Page or UserControl. If it does, add it

to
your list of class names.

"Milsnips" <mi******@hotmail.com> wrote in message
news:es**************@TK2MSFTNGP11.phx.gbl...
Can anyone help out on this one?

i would like to find out all the ASPX and ASCX pages that are in my

project,
and return them in an arraylist.

thanks,
Paul.



Nov 18 '05 #5

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

Similar topics

2
by: Alex Nitulescu | last post by:
Hi. I have a web.config which says that all files with the "axd" extension should by a special handler. The handler writes some stats to the "axd" page. Public Class WhosOnHandler Implements...
3
by: larry mckay | last post by:
I'm trying to programatically print the content that is rendered in an internet explorer control. if do webbrowser.navigate ("http://www.yahoo.com") the content of the webpage appears in the...
1
by: Nick via .NET 247 | last post by:
I have a similar problem trying to use web services with awindows form application. I currently use a static web referencein my project. What I am trying to do is to programaticallychange the url...
3
by: Ben Crinion | last post by:
I am creating a web service which will be available on only one of two servers at a time. Both servers will have exactly the same services running but one will be a backup which just waits doing...
5
by: Tim Mackey | last post by:
hi, i have put my web.sitemap in /App_Data so i can edit it programatically via a web admin page, inheriting the modify permissions from the App_Data folder etc. i was hoping the provider would...
2
by: Grey Alien | last post by:
I am trying to programatically POST an ASP form, to allow me to log on to a site programatically. <form name="aspnetForm" method="post" action="Default.aspx" id="aspnetForm"> <input...
0
by: NETCODE | last post by:
I am developing an add-in. I need to retrieve the path of .msi file, located in under project properties, from the deployment project (setup). I was able retieve all project properties of all...
7
by: The Mad Ape | last post by:
Hi I have code to programatically create a label. It works but when I try to call a sub to create a tooltip it does not work. I do not get an error so have no idea what it wrong. Please review...
2
by: Phil Sandler | last post by:
All, I am trying to build a program that collects some metadata from my Asp.net application. I want to collect properties of a few specific types of controls that are used on a number of pages....
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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
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
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.