Har fundet et spørgsmål på engelsk fuldstændigt magen til mit - måske kan det hjælpe? Han havde heller ikke fået svar...
Solution Title: Executing ASP code stored inside a database
Date Asked: 07/18/2004 07:51AM PDT
Date Answered: 07/18/2004 03:30PM PDT
I have an application where a user will store raw html code in a database. The code is displayed like this:
if not objRS.eof then
Response.write(objRS("strHTML"))
else
Response.write("No record found <br> <a href=# onClick=""window.close();return false;"">Close</a>")
end if
This works perfectly fine. The problem, however, is when ASP code is stored in the database, the asp code itself appears in the page but it does not get executed. For example, if the value in the database is this:
<%Response.write("Hello")%>
The output is this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Condition Preview Page</TITLE>
</HEAD>
<BODY>
<%Response.write("Hello")%>
</BODY>
</HTML>
and the code is not executed. Any ideas?