If you are preparing Active Server Pages code for printing or for code review it helps to make the script as tidy as possible. A free utility called HTML Tidy from http://www.w3.org/People/Raggett/tidy/ does an excellent job of putting HTML in order. Unfortunately, Tidy doesn’t preserve ASP code. For example, it converts ASP delimiters into HTML escape codes so that <% turns into <%. However, if you make a backup and then note the conversions, you can use your editor's Search and Replace feature to reverse key changes and get back your ASP code. Just replace < with < and so on. In addition to the delimiters, watch for changes to the ampersand (&).
HTML Tidy runs from the command prompt. Here’s the contents of a batch file called dotidy.bat:
tidy -i -m -u -raw -f errors.txt -wrap 200 %1
Call the batch file by passing the filename to it as in:
dotidy.bat myfile.asp
I’ve asked the author of HTML Tidy to add a switch that protects ASP code. Perhaps additional requests at his Web page will provide an incentive.