How to escape asp directive output
So i need print to page string with asp tags
<%
response.write "<%=Count%>"
%>
But I get error
Microsoft VBScript compilation error '800a0409' Unterminated string constant
So how to print script tags?
So i need get <%=Count%>
not Count
There are any way instead of ?
<%
response.write "<" & "%=Count%" & ">"
%>
You just need to make sure you HTML encode before attempting to use Response.Write()
something like this;
Here I use the HTML encoded value of %
which is %
to stop the VBScript run-time from spitting it's dummy (but you can use anything even <
for <
and >
for >
as has been suggested).
<%
Response.Write "<%=Count%>"
%>
Outputs:
<%=Count%>