Problem with MVC

I have an mvc application running on IIS 7.0 on windows vista. The application is redirected to the correct controller and action. But I get an error message that does not appear in the path when the view is present in the specific path.

The route is shown below.

routes.MapRoute ("By default", // Route name

"home / {action} / {id}", // URL with parameters

new {controller = "Home", action = "Index", id = ""} // Parameter restrictions);

I get an error because the "Pointer" cannot be located on these paths: ~ / Views / Home / Index.aspx, ~ / Views / Home / Index.ascx, ~ / Views / Shared / Index. aspx, ~ / Views / Shared / Index.ascx when I run the mvc application http: // localhost / mvcsf / Home /

+4
source share
3 answers

Try something like this, it looks like it is in the Windows functions that come with IIS 7:

http://blogs.dovetailsoftware.com/blogs/kmiller/archive/2008/10/07/deploying-an-asp-net-mvc-web-application-to-iis7.aspx

0
source

The choice of view is determined by the controller. What does a home controller do for index action? If this is a vanilla site created by the system, he expects to find "~ / Views / Home / Index.aspx" through the action of the controller (see below). So: does this index page exist?

public ActionResult Index() { ViewData["Title"] = "Home Page"; ViewData["Message"] = "Welcome to ASP.NET MVC!"; return View(); } 

(the default view has the template {controller} / {action}, you can specify other views through overloads on View(...) )

0
source

I had to reconfigure IIS to handle MVC applications. Check it out also:

MVC Config in IIS v6.0

0
source

All Articles