SQL PHP HTML ASP JavaScript articles and free scripts to download
 

Printing double quotes in ASP

In ASP VBScript we can't print a double quote inside at output statement. We have to take special care to display a double quote inside or outside a string.

(In PHP we can easily escape the double quote by using escape character ( like \" ) ).

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 )

We can use " to print double quotes to the screen

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")
Further readings
Configuring IIS to run website in local PC
ASP Introduction
ASP Installations
Basic File structure for simple ASP script
Advantage Disadvantage of ASP
Tasks ASP Can do
Buffer On or Off in ASP to control data flow to client browser
Different requirement for redirecting users
Response Object in header redirecting of browser
Escaping double quotes and printing to screen
 
Scripts
PHP
JavaScript
All ASP Tutorials
Popular Tutorials
Managing two drop downs
ASP Tutorials
Date and time
Declaring array
Form in ASP
Server.MapPath
Date Time & MSSQL
Select Query
File System Object
Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.