What's the equivalent of <%-- --%>
in ASP Classic?
I have to modify a legacy ASP application and I'd like to comment out a block of HTML:
<td>
some table cell I'd like to comment out, including
some <%= inlineServerSideVBScriptExpressions() %>
</td>
Wrapping everything in <%-- ... --%>
, as I'd do in ASP.NET, doesn't work and results in the compilation error "Expected statement". HTML comments <!-- ... -->
are not an option either, since the inline ASP expressions would get evaluated and fail.
This is what source control is for. Just delete the code and mark it appropriately when you check it in so you can find the snippet later if you need it.
Here is how I can easily comment out an entire block of mixed code:
If I had to do this many times I would make some kind of macro for my computer to do this via hotkey.
There's no "built-in" way to do block comments in ASP Classic. You have to put a
'
before each line you don't want to run.Try this:-
The
METADATA
indicates to the ASP processor that this is a comment that does not need to be sent to the client.Another way to block comment your code is to escape back out of the VBScript at the point where you want the comment to be and insert standard HTML comments, like so...
The way I always comment out is using: