In the following *.asp file, the server barfs when it encounters the "document.write()" statement when within "<% ... %>. If I change the <% %> with <script> </script>, it works OK.

<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Testing Document Write</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<%
document.write("<h2>You can use HTML tags to format the text!</h2>");
%>
</body>
/html>