Is there a method to get all of the .aspx files in my website? Maybe iterate through the site's file structure and add to an array?
+1
A:
using Directory.GetFiles("*.aspx"), you can get all the files in the directory. And you can make it recursive to grab any sub directories and their files.
Darren Kopp
2008-10-10 14:51:43
+5
A:
Directory.GetFiles(HttpContext.Current.Server.MapPath(@"/"), "*.aspx", SearchOption.AllDirectories);
Shawn Miller
2008-10-10 14:52:43
A:
Keep in mind that you can define an .aspx page without having an actual file be there in the web.config.
swilliams
2008-10-10 14:55:24
thanks, I will keep that in mind.
Anders
2008-10-15 14:03:13