Ask the Expert

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.

    Requires Free Membership to View

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:
http://msdn.microsoft.com/library/en-us/iissdk/iis/creating_isapi_filters.asp.

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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: