简体   繁体   中英

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

您是否取消选中了扩展映射上的“验证文件是否存在”框?

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM