Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Response.Write - HTML texts 2

Status
Not open for further replies.

damipera

Technical User
Dec 1, 2005
134
GB
hi guys,

can you give me some ideas please.

i want to output on an asp page the html texts from database using response.write, but this code below gives an error

Code:
<% response.write("hello world<br><img src="somepix.jpg">") %>


changing the double quotes to the following gives no error, but this is not an option as i don't want to touch whatever is in the database

Code:
<% response.write("hello world<br><img src=""somepix.jpg"">") %>
<% response.write("hello world<br><img src='somepix.jpg'>") %>

do you have any ideas you can recommend? thanks


.
 
You can double up the double quotes with:
[pre]Replace(string, Chr(34), Chr(34) & Chr(34))[/pre]
 
hi guitarzan, thanks for your reply.

how do i implement that using my example above?

 
Run the string from the DB through a replace function first.

OR

read the db text into a variable and response write that.



Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
It works!

Thanks Guitarzan and Chris for your advice. Have a nice day.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top