Technical Tips and Solutions

Back to Tech Tips

16/01/2003 - Displaying ASP code stored in a database in a web browser.

The <% in a ASP code is always interpreted by the browser as code. This means that any code entered in a body of text such as this will be ignored when displayed. The following code snippet does a replace of code and CR/LFs.

<%= replace(replace(replace(rs.fields("Body"),"<","<"), ">",">"),chr(13) & chr(10), "
")%>

Back to Tech Tips