Click to See Complete Forum and Search --> : Using <% and %> inside a Response.Write


NatuScape
02-20-2003, 11:00 AM
Hi all!

I need to use <% and %> inside a Response.Write... I know there's a simple way to do this, but I can't figure it out or find it elsewhere on the web...

Help! Thanks!!!

Natalia

Ribeyed
02-20-2003, 11:18 AM
hi,
yes you can't use <%%> within a response.write.

like this:

<%
if bla...bla..bla....

rsponse.write "This variable <%=variablename%>"

end if
%>
This would generate an error. Instead do this:
<%
if bla...bla..bla....

rsponse.write "This variable "&variablename&""

end if
%>

Nicodemas
02-21-2003, 01:38 AM
You could possibly use escape characters?

In HTML, the percent character is % and in ASP you could use chr(37)

NatuScape
02-21-2003, 11:57 AM
Hi again!

I actually solved this using Ribeyed's suggestion, but neglected to post my thanks... so: Thanks for the help everyone!!!

Natalia