United States
Quick Links  | Home | Worldwide
Microsoft
Search Microsoft.com for:
Help and Support  
| Select a Product | Search Knowledge Base

You receive a "Page cannot be displayed" error message when you use an ASP.NET application to open an .htm file or another static file that is hosted in IIS 6.0

Article ID : 909641
Last Review : November 30, 2005
Revision : 1.0
On This Page

SYMPTOMS

Consider the following scenario:
Microsoft Internet Information Services (IIS) 6.0 is running on a Microsoft Windows Server 2003-based computer.
You have an existing Microsoft ASP.NET application that is running on the Microsoft .NET Framework 1.1 or on the Microsoft .NET Framework 1.0.
This application is mapped to the corresponding .NET Framework 1.1 Aspnet_isapi.dll file or to the corresponding .NET Framework 1.0 Aspnet_isapi.dll file in IIS 6.0.
You install the Microsoft .NET Framework 2.0.
You modify the ASP.NET application to use the .NET Framework 2.0, and then map the ASP.NET application to Aspnet_isapi.dll file in the .NET Framework 2.0.
In this scenario, you may receive an error message that is similar to the following when you use the ASP.NET application to open an .htm file or another static file that is hosted in IIS 6.0:
"The page cannot be displayed"

Back to the top

CAUSE

This issue occurs when a corresponding mapping for the file name extension does not exist in the ASP.NET HTTP handlers configuration.

Note This issue does not occur if the Aspnet_isapi.dll file is configured as a wildcard application map in IIS 6.0.

Back to the top

WORKAROUND

To work around this issue, use one of the following methods.

Back to the top

Method 1: Create a mapping in ASP.NET at the level of the IIS 6.0 script map

Create specific mappings in the ASP.NET HTTP handlers configuration to the static file handler (System.Web.StaticFileHandler). Create a mapping in the ASP.NET HTTP handlers configuration for each specific mapping in the IIS 6.0 scriptmaps.

For example, add a mapping in the ASP.NET HTTP handlers configuration for files that have the .htm file name extension. To do this, add the following code to the httpHandlers element in the Web.config file at the level that corresponds to where the IIS 6.0 script mapping is defined. If Aspnet_isapi.dll is mapped globally, use the Web.config file in the Config folder that is located in the .NET Framework installation folder.
<add path="*.htm" verb="*" type="System.Web.StaticFileHandler" />

Back to the top

Method 2: Create a mapping in ASP.NET in the root Web.config file

Modify the root Web.config file. To do this, locate the following code in the root Web.config file.
<add path="*" verb="GET,HEAD,POST" type="System.Web.DefaultHttpHandler" validate="True" />
Replace that code with the following code.
<add path="*" verb="GET,HEAD,POST" type="System.Web.StaticFileHandler" validate="True" />

Back to the top

MORE INFORMATION

Microsoft ASP.NET 2.0 delegates static file processing back to the IIS 6.0 static file handler through the Execute URL server support function. This behavior lets you to run ASP.NET authentication and authorization modules while serving static content.

Because ASP.NET 2.0 delegates static file processing back to IIS 6.0, any explicit script mapping that maps a file name extension to ASP.NET must have a corresponding mapping in ASP.NET. If the corresponding mapping in ASP.NET does not exist, ASP.NET passes the file processing back to IIS. IIS detects this recursion and then sends an empty HTTP response.

By default, default file name extensions are mapped to the DefaultHttpHandler in ASP.NET 2.0. In ASP.NET 1.1 and in ASP.NET 1.0, default file name extensions are mapped to the StaticFileHandler.

Back to the top

REFERENCES

For more information about how the httpHandlers element is configured in the root Web.config file, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/bya7fh0a.aspx (http://msdn2.microsoft.com/en-us/library/bya7fh0a.aspx)

Back to the top


APPLIES TO
Microsoft .NET Framework 2.0

Back to the top

Keywords: 
kbtshoot kbprb KB909641

Back to the top

 

Search Support (KB)

 
Switch to Advanced Search

Article Translations

 

Related Support Centers

Other Support Options

  • Contact Microsoft
    Phone Numbers, Support Options and Pricing, Online Help, and more.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.

Page Tools


© 2007 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement