Printing double quotes in ASP

In VBScript, a double quote inside a quoted string is represented by doubling the quote character. You can also generate a quote with Chr(34).



Here are some examples to display double quotes in ASP

We can use chr(34) to print a double quote to the screen
Response.Write chr(34)
( Try different values of chr to display different characters to the screen )

When building HTML output, " is the HTML entity for a quotation mark. Inside a VBScript string literal, the quote characters that delimit or appear inside that string still need valid VBScript quoting.
Response.Write """
Some time within a string we will have double quotes to print. Here to print one double quote we will escape it by one more double quote so two double quotes are to be used. Read this line.
Response.Write "Raju told ""ASP is a better scripting language""" 
The above line will print
Raju told "ASP is a better scripting language"
Mark the use of two double quotes within the string to display single double quotes.

Some time we have to display some variable or strings with double quotes within a table cell. Here is a code to display session id inside a table cell.
Response.Write "<tr><td>session(""userid"")</td><td>"
The output of the above is
 session("userid")  

ASP Home






✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer