0

I have a mobile website, intercepting the stylesheet/images and setting sizes relative to the device. I have been testing it on IIS7 and works fine.

The live site is IIS6 (lil surprise)...

Normal routing for friendly urls works fine, but the stylesheet/images intercept is not doing anything.

Here is a snippet of my global.asax routing section :

public static void RegisterRoutes(RouteCollection routes)
{
                routes.RouteExistingFiles = true;

                routes.MapPageRoute("ImageResizerS", "images/{Sub}/{Path}", "~/Site_Handlers/ImageResize.ashx");
                routes.MapPageRoute("ImageResizer", "images/{Path}", "~/Site_Handlers/ImageResize.ashx");

                routes.MapPageRoute("StyleSheetIntercept", "Styles/{Path}", "~/Site_Handlers/InterceptStyleSheet.ashx");

                routes.MapPageRoute("Landing page", "", "~/Site_Files/LandingPage.aspx");
    }

What seems to be the problem?

What I have noticed :

When I set routes.RouteExistingFiles = true; to false. It creates the same behavior on IIS7 & IIS6...no intercept.

Marc Uberstein
  • 12,501
  • 3
  • 44
  • 72

2 Answers2

1

In IIS6, you need to enable wildcard mapping to ensure that the correct handler picks up the request (in this case ASP.Net), otherwise it will just be served like a static web page. See Microsoft web site for a how to.

The executable path in step 4 will vary depending on your .Net version, but the easiest way is to copy the value from one of the other mapping that .Net already handles (.aspx, .ashx, etc.)

bittenbytailfly
  • 233
  • 1
  • 7
0

On the server, open IIS:

  1. Right-click on the site/virtual directory, select properties
  2. Goto the Home Directory/Virtual Directory tab, click Configuration (near the bottom)
  3. Near the bottom again, click the insert button
  4. Enter C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll - Used v4 in this case.
  5. Uncheck the "Verify that file exists" button, click Okay and close all the dialogues

REFERENCE: ASP.NET routing on IIS 6

Community
  • 1
  • 1
Marc Uberstein
  • 12,501
  • 3
  • 44
  • 72