Special Characters

When you use Active Server Pages, there are several special characters that you use in your code.  Here is a list and description of the most common special characters:

All ASP code must be placed inside the <% %> delimiters or the code will not execute.  If you enter ASP code on an HTML web page without the delimiters, the code will simply display as plain text.

'Your ASP code here.


The single ‘ quotation mark signifies a comment within ASP code.  Comments are generally used for organizational purposes in web design so that webmasters can share work easily and test for bugs in their website.  You can also see the single quotation mark used in the above example.


The ampersand & symbol is a concatenation operator that is used to combine two expressions into a string result.  Here is an example from our AspEmail script:

Mail.Body = "Email: " & strEmail & vbCrLf & "Name: " & strName


The underscore _ signifies that one single string of code is being written on more than one line, usually because the line is too long.  In ASP, many portions of code are designed to be written on one single line. If the line becomes too long and runs off the page, you can simply enter an underscore at the end of the line, return to the next line, and continue writing your code as if it were still one the same line.  Although the code is written on more than one line, it will still function as one line of code.  Here is an example:

Response.Write("This script runs spans multiple lines "&_
"but it will execute as one statement")


vbCrLf simply returns to the next line.  This is most commonly used when displaying data such as in an email message.  If you have two form fields that you want to display on separate lines in an email, simply add a vbCrLf between their code in your ASP page.  You can see this used in our AspEmail script from the ASP Scripts page.

< Back to ASP Tutorials