ASP 101 - Active Server Pages 101 - Web04
The Place ASP Developers Go!

Windows Technology Windows Technology
15 Seconds
ASP 101
ASP Wire
VB Forums
VB Wire
internet.commerce internet.commerce
Partners & Affiliates
ASP 101 is an site
ASP 101 is an site
Internet News
Small Business
Personal Technology

Corporate Info
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash

ASP.NET version of "Directory List (Sorted)"

ASP.NET's file system processing is much more advanced then what was available in classic ASP. Despite all the improvements (including an easy way to filter your results), for some reason, there's still no built-in way to sort the resulting file list. I guess it makes sense... after all who would ever want to list their files ordered by name, date, size, or type... that's just madness... or is it?

I use a similar approach to what I did with our classic ASP version. In a nutshell, I transfer the file information into a DataTable and use its built-in sorting mechanism to avoid having to do the actual heavy lifting of storing and sorting the data. It's not rocket science, but it's not exactly the most obvious approach either.

If nothing else, the code is a good example of how you can build and use DataTables, DataRows, and DataViews without ever connecting to a database. You can do the same with DataSets and other database related objects... I just didn't have the need.

Here's a zip file of the code (16.5 KB).

Play with the running version.

Back to the "Directory List (Sorted)" sample


Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback
The Network for Technology Professionals



Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers