Microsoft KB Archive/246828

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 13:50, 21 July 2020 by X010 (talk | contribs) (Text replacement - """ to """)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Base


Article ID: 246828

Article Last Modified on 7/16/2001



APPLIES TO

  • Microsoft Active Server Pages 4.0



This article was previously published under Q246828

SYMPTOMS

When creating and scripting new Active Server Pages (ASP) pages, you may receive the following error:

Active Server Pages error 'ASP 0221'
Invalid @ Command directive

This error occurs when you use the following syntax:

<%@ LANGUAGE="VBScript"
Response.Write "Generic ASP Code"
' Generic ASP Code
%>
                

CAUSE

The @ processing directive is not terminated properly.

RESOLUTION

Terminate the @ processing directive properly as shown below:

<%@ LANGUAGE="VBScript" %>  '@ directive line terminated

<%  'Start script here
Response.Write "Generic ASP Code"
' Generic ASP Code
%>
                

STATUS

This behavior is by design.

MORE INFORMATION

The @ processing directive sends information to Internet Information Server (IIS) on how to process an ASP page. The LANGUAGE processing directive is used most often and sets the default server-side scripting language on an ASP page. Other processing directives include, but are not limited to, the following:

  • ENABLESESSIONSTATE
  • CODEPAGE
  • LCID
  • TRANSACTION


If more than one processing directive is needed on an ASP page, use the following code for two or more processing directives:

<%@ LANGUAGE="VBScript" ENABLESESSION="False" %>
                

Keywords: kberrmsg kbcodesnippet kbprb KB246828