Gilly
Gilly

Reputation: 77

MVC with IIS 6

I've read a couple of posts on this issue but still can't seem to get MVC working on IIS 6. I've mapped .mvc to aspnet_isapi.dll in IIS but get a 404 when I browse to my mapped URL which looks like this

RouteTable.Routes.MapRoute("action", "api.mvc/{controller}/{action}", new {action = "Index"});

I then browse to //localhost/Web.Site/api.mvc/Users/List but get a 404 returned

same happens for

//localhost/Web.Site/api.mvc/Users/

I have a UsersController with List and Index that both returns a ViewAction

Is there anything else I need to do? Or have I missed something

cheers

also.............

I should point out that my redirect my default page in the website is working

eg my default code behind has

        HttpContext.Current.RewritePath(Request.ApplicationPath, false);
        IHttpHandler httpHandler = new MvcHttpHandler();
        httpHandler.ProcessRequest(HttpContext.Current);

so the default "/" request does get correctly routed via this in the global.asax.cs

        RouteTable.Routes.MapRoute("default", "", new {controller="Home", action = "Index" });

not sure if that helps anyone

Upvotes: 1

Views: 338

Answers (2)

whatupdave
whatupdave

Reputation: 3354

Try deleting your default.aspx page and make sure you have this in your web.config:

<httpModules>
    <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing"/>
</httpModules>

Upvotes: 1

Marc Gravell
Marc Gravell

Reputation: 1064184

Have you unchecked the "Verify that file exists" box on the extension mapping?

Upvotes: 3

Related Questions