Asp.net mvc: page not found

I am trying to set up an MVC development environment on my laptop. I am running WinXP Pro with IIS 5.1

I got my environment setup with a sample MVC application that ships with the beta. I can only get to the home page. when I try to open the About page. I cannot find the error on the page. Is this routing not set in Global.asax?

+1


source to share


4 answers


Your problem is that IIS 5/6 doesn't play well with non-extension routes, the master page is resolved because it points to default.aspx.

In short, do the following:

If the * .mvc extension is not registered with the hosting, it will throw a 404 exception. In this case, the working way to host MVC applications is to change the global.asax routing as follows.

 routes.Add(new Route("{controller}.mvc.aspx/{action}", 
       new MvcRouteHandler()) 
       { Defaults = new RouteValueDictionary (new{ controller = "YourController"} ) });

      

This way your whole controller request will be in * .mvc.aspx which is recognized by your hosting. And since the MVC DLLs are copied to your local bin, no special settings are required for this.



See this question for a lot of good information:

ASP.NET MVC and IIS 5

+1


source


You can take a look at this article that might help you: http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx



+1


source


You can go to the properties of your IIS site, Home tab, click Config ..., select .aspx, click Paste ..., type c: \ windows \ microsoft.net \ framework \ v2.0.50727 \ aspnet_isapi.dll ", uncheck the box and click" Ok ". It helped me.

+1


source


Recycling urls can help you fix the problem. I have implemented a solution that allows you to deploy an MVC application in any version of IIS, even if using shared hosting. http://www.codeproject.com/KB/aspnet/iis-aspnet-url-rewriting.aspx

0


source







All Articles