views:

177

answers:

3

I am trying to upload an ASP.NET MVC application in a shared server running on IIS 6 and Windows 2003. I don't have access to IIS. I've changed the global.asax.cs file as follows:

        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
            "Default",
            "{controller}.aspx/{action}/{id}",
            new { action = "Index", id = "" }
          );

        routes.MapRoute(
          "Root",
          "",
          new { controller = "Home", action = "Index", id = "" }
        );

It is working fine, but it doesn't drop the .aspx at the end of the controller. Is there a way to remove the .aspx extension in the URL?

+1  A: 

No, it's because your host has not set IIS to send all requests through ASP.NET. The only thing you can do is to ask your host to change this setting.

ZippyV
A: 

As far as I know you're URI's should work off the bat providing you are on IIS7.

If you are on IIS6 however you will need to jump through some hoops to get extensionless URI's.

This guide may help - haacked.

As far as I can tell though you'll need access to handler mappings in IIS6, which you probably won't have on your shared host.

Sergio
the haacked tutorial was very useful.thanks. but i have no IIS access..:( no use in being happy if the application works perfectly well in the development machine alone, right? :)
ZX12R
A: 

Change the host. Seriously. Shared hosting STILL using IIS 6 - that is brutal. Hosts should have switched over quite some time ago.

TomTom
said very easily...:) i am stuck with a client who has already bought the space and the provider is least responsive...:(
ZX12R