ASP2HTML

Download ASP2HTML

Introduction

When I started designing this web site, I wanted all the pages to have a consistent look and feel, and I wanted to play with some cool new technologies in the process. I had some previous experience with Active Server Pages (ASP), and was rather impressed by how easy it was to change the site just by changing a couple of include files. So away I went, setting up IIS on my home PC and using that to see what my site would eventually look like.

However, when I signed up to my current ISP, ASP support wasn't high on my list of requirements (i.e. how much would it cost). So, when I came to upload my website to my ISP and view it via the web, I got a load of really plain pages full of <!-- and <%= tags that the web browser just ignored.

I didn't want to rewrite the site - I really liked the flexibility that ASP offered, and I don't want to change ISP just yet. Enter ASP2HTML...

I'd been playing around with the Internet Explorer automation model when writing my Mouse Gestures plugin. Could I use the same automation model to traverse my website and convert each ASP page to the HTML page that the web browser ultimately downloads. If you've got this far then the answer was obviously yes!

Using ASP2HTML

Using ASP2HTML is really simple. Just open the application and you're presented with this simple user interface:

Enter the URL of the first page you want to transcribe, and a directory where you want the transcribed HTML pages to be output. Click on Start:

Starting at the URL you've entered, ASP2HTML loads the ASP page into an HTML document. It scans the downloaded HTML document, and extracts links to other ASP pages on the same server. Each of these links is patched so it refers to an HTML page on the server. The HTML document is saved, with an HTML extension, to the output directory and each of the above links is visited and the process repeated.

Additionally, ASP2HTML searches the HTML document for other linked documents (e.g. style sheets, images, zip files) and makes a copy of those files to the appropriate location in the output directory.

Case sensitive filenames

When I first deployed the HTML'ified web-site to my ASP, I found that a number of the links no longer worked. This was because the (Windows based) ASP based web-site is case-insensitive, whereas my (*nix based) ISP was case-sensitive.

Rather than patch all the links manually, I updated ASP2HTML to (optionally) convert all links to lower-case and save all files with a lower-case filename.