Putting a menu bar at the top of every page
I am trying to find a way to get IIS 5 to put a small menu bar at the top of every page I host on the server. I would like to avoid using frames so hosted sites can view their paths and users can bookmark pages. It would be preferable if the server could do this transparently...inserting the code on every page just below the body tags, and presto it's done. So far, I am unable to do this without using a frame setup. It's not too good for business if no paths are displayed and no users can bookmark favorite pages.
There's nothing built into IIS to provide this. So, you'll need to either write or buy an application. The best way to do this would be to create an ISAPI filter, because ISAPI filters have the capability to modify requests and responses without necessarily interfering with the normal file processing. Here's Microsoft's information on creating custom ISAPI filters:
Writing ISAPI filters is hard, though, even for experienced developers. An easier approach would be to create a Perl script that was capable of reading an HTML file, replacing the "<body>" tag with "<body>your_html". This could be a very short script; just a few lines. Then, in IIS extension mapping, map all common HTML file extensions (.htm, .html) to your Perl script. IIS will call the Perl script, pass the path to the requested file as an argument, and send the Perl output back to the Web browser.
I wish I could point you to a download of an existing tool that would do this for you, but I can't find one.
This was first published in May 2004