Article ID: 307190
Article Last Modified on 9/24/2001
APPLIES TO
- Microsoft Active Server Pages 4.0
This article was previously published under Q307190
SYMPTOMS
When you view an Active Server Pages (ASP) page in the browser, you may receive the following error message:
CAUSE
This error occurs if the server reads two lines of code that contain the @ command in server script. Often, this happens if the main page contains a line such as:
<% @Language=VBScript %>
and also contains a server-side include file that points to another page that contains the same line.
RESOLUTION
To resolve this problem, make sure that you only use the @ command once in the page, and make sure that your include files do not contain a line with the @ command. If you need to change language in the middle of the page, use a script block. For example:
<SCRIPT Language=VBScript Runat=Server> ... </SCRIPT>
STATUS
This behavior is by design.
MORE INFORMATION
Microsoft Script Encoder adds the following line by default to pages with an .asp file extension that it encodes:
<%@ LANGUAGE = VBScript.Encode %>
If your include files have an .asp file extension, you will probably encounter this problem.
Steps to Reproduce Behavior
In Notepad, create a new ASP page named P1.asp, and paste the following code:
<%@Language=VBScript%> <!-- #include file="Hello.asp" --> <%=" World"%>
- Save P1.asp in your Default Web Site's home directory.
- In Notepad, click New on the File menu.
Create a new ASP page named Hello.asp, and paste the following code:
<%@Language=VBScript%> <%="Hello"%>
- Save Hello.asp in your Default Web Site's home directory.
- In your browser, type the following address in the Address bar:
http://<localhost>/P1.asp
Keywords: kbscript kbaspobj kbprb KB307190