May 22 2008

Running Classic ASP pages inside Classic Mode in IIS 7.0

Category:Bil@l @ 19:45

I have been trying for a while to run classic ASP pages inside an application hosted on IIS 7.0 and running under the Classic Mode Application Pool.

In IIS 6.0, there was the concept of Wild-Card Mapping where you map all requests to the ASP.NET ISAPI extension to be processed by the ASP.NET engine. As you know, when running an application hosted inside IIS 7.0 and running under the Classic Mode application pool, it behaves similarly as if it was hosted inside IIS 6.0.

To define a wild-card in II 7.0 for applications running under Classic Mode application pool follow the steps:

  1. Click on the application you want to configure the wild-card for it inside IIS 7.0.
  2. Make sure the application is running under the classic mode application pool
  3. On the home page of the application, double click on the Handler Mappings applet. This applet shows all the extension mappings defined for the current application that are already inherited from the Default Web site.
  4. Click on the Add Script Map  on the Actions pane on the right. A dialog box pops up allowing you to enter the details of the mapping you want. The diagram is shown in the figure below.

In the Request Path field you enter "*". In the Executable field you enter the ASP.NET ISAPI extension so that all requests will be redirected to ASP.NET engine. In the Name field you enter the name of the new mapping you are defining.

Once you have defined the above, click on the Request Restrictions button to show the dialog box in the figure below.

 

Clear the Checkbox above so that you don't put any restrictions on the requests to be mapped to the ISAPI extension defined.

Now when you run the ASP page inside your application, it will work fine! What happens is that the .asp page will first be handled by the defined handlers inside IIS 7.0, once the specified handlers are executed, IIS 7.0 sends the request to ASP.NET ISAPI extension to be executed!

 

Hope this post helps you!
Regards

Tags:

Comments are closed