Microsoft Knowledge Base Email Alertz

(307190) - When you view an Active Server Pages (ASP) page in the browser, you may receive the following error message: Error Type: Active Server Pages, ASP 0141 (0x80004005) The @ command can only be used once within the Active Server Page. /pagename.asp,...

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 307190 - Last Review: September 24, 2001 - Revision: 1.0

PRB: Error 0x80004005 When You View ASP Page in Browser

This article was previously published under Q307190

On This Page

SYMPTOMS

When you view an Active Server Pages (ASP) page in the browser, you may receive the following error message:
Error Type:
Active Server Pages, ASP 0141 (0x80004005)
The @ command can only be used once within the Active Server Page.
/pagename.asp, line xx

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

  1. In Notepad, create a new ASP page named P1.asp, and paste the following code:
    <%@Language=VBScript%>
    <!-- #include file="Hello.asp" -->
    <%=" World"%>
    					
  2. Save P1.asp in your Default Web Site's home directory.
  3. In Notepad, click New on the File menu.
  4. Create a new ASP page named Hello.asp, and paste the following code:
    <%@Language=VBScript%>
    <%="Hello"%>
    					
  5. Save Hello.asp in your Default Web Site's home directory.
  6. In your browser, type the following address in the Address bar:
    http://<localhost>/P1.asp

APPLIES TO
  • Microsoft Active Server Pages 4.0
Keywords: 
kbaspobj kbprb kbscript KB307190
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate