Symptoms that are exhibited at run timeWhen you view an .aspx page in a Microsoft ASP.NET Web application, you may experience the following symptoms:
- A blank page may appear in the browser.
- You may receive an instruction to download the .aspx page.
Symptoms that are exhibited when you use Visual Studio .NET to debug ASP.NETWhen you debug an ASP.NET application in Microsoft Visual Studio .NET, you may receive the following error message in the IDE:
You may also want to refer to the ASP.NET and ATL Server debugging topic in the online documentation. Would you like to disable future attempts to debug ASP.NET pages for this project?
The new settings are not in place if either of the following statements applies to your situation:
- IIS was not installed when you ran the .NET Framework SDK or Visual Studio .NET Setup.
- You removed and then reinstalled IIS after you ran the .NET Framework SDK Setup or the Visual Studio .NET Setup.
To repair IIS mappings for ASP.NET, run the Aspnet_regiis.exe utlity. To do so, follow these steps:
- Click Start, and then click Run.
- Type cmd, and then click OK.
- At the command prompt, type the following command, and then press ENTER: "\WindowsFolder\Microsoft.NET\Framework\VersionNumber>\aspnet_regiis.exe" -iNote Replace
WindowsFolder with the name of the directory where the operating system is installed. Replace VersionNumber with the .NET Framework version installed on your computer.
- Click Start, and then click Run.
- Type regsvr32 WindowsFolder\Microsoft.NET\Framework\VersionNumber\aspnet_isapi.dll, and then click OK. Regsvr32 returns the results of the registration.
Steps to reproduce the behaviorFollow these steps to verify whether or not you see the issue described in this article. This test checks for the typical symptoms that are related to the issue. If you are already familiar with how IIS application mappings work, you can also follow the steps in the "How To Verify Your IIS Application Mappings" section of this article to verify the configuration of your Web server.
- To create an ASP.NET Web application, use Visual Studio .NET. To do so, follow these steps:
- Start Microsoft Visual Studio .NET.
- On the File menu, point to New, and then click Project.
- In the New Project dialog box, click either Visual C# Projects or Visual Basic Projects under Project Types, and then click ASP.NET Web Application under Templates.
- In the Location box, replace the WebApplication# default name with MyWebApp. If you use the local server, you can leave the server name as http://localhost. The resulting Location box appears as follows:http://localhost/MyWebApp
- In Solution Explorer right-click the project node, point to
Add, and then click Add Web Form. Name the Web Form MappingsTest.aspx, and then click Open.
- Right-click the .aspx page in the editor, and then click View Code. Add the following code to the Page_Load event handler:
Visual C# .NETVisual Basic .NET
private void Page_Load(object sender, System.EventArgs e)
Response.Write("This code was executed");
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Response.Write("This code was executed")
- On the File menu, click Save All to save the Web Form and other associated project files.
- On the Build menu in the Visual Studio .NET IDE, click Build Solution.
- Right-click the .aspx page, and then click View in Browser.
- If the mappings are correct, the "This code was executed" message appears in the browser. If the mappings are not correct, one of the following behaviors occurs:
- A blank page appears in the browser.
- You receive a prompt to download the .aspx page.
<%@ Page language="c#" Codebehind="MappingsTest.aspx.cs" AutoEventWireup="false" Inherits="MyWebApp.MappingsTest" %>
How to verify your IIS application mappingsTo verify that the application mappings are correct, follow these steps:
- Click Start, point to Programs, point to Administrative Tools, and then click Internet Services Manager.
- Expand the node that corresponds to the local host (computer name), and then expand the Default Web Site node.
- Right-click your Web application directory, and then click Properties.
- On the Directory tab, under Application Settings, click Configuration.
- Click the App Mappings tab.
- On the App Mappings tab, under Application Mappings, check whether the .aspx extension is mapped to the following DLL: C:\WindowsFolder\Microsoft.Net\Framework\VersionNumber\aspnet_isapi.dllNote
Replace WindowsFolder with the name of the directory where the operating system is installed. Replace VersionNumber with the .NET Framework version that is installed on your computer.
- If you cannot find the application mapping entry, follow the steps in the "Resolution" section of this article.
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
ID d'article : 325093 - Dernière mise à jour : 24 mars 2009 - Révision : 1