I just download ASP.NET MVC 2 Preview 2, create a new project and run it. But why it displays a directory list rather than default page ? I'm using VS2008 SP1 and ASP.NET MVC 1 installed.
A:
You should check your global.asax routing rule to make sure you have a default routing rule set, which matches up to a controller and action on your site.
Sohnee
2009-10-08 13:28:44
I think there's no problem with the routing. I open the MSDN sample (the MvcAreasSingleProject.zip) and same thing happened.
2009-10-09 01:42:14
I still think you should check to make sure you have a default route as it will apply to requests made to the root in your live site. Example... routes.MapRoute("Default", "{controller}.mvc/{action}/{id}", new { action = "Index", id = "" }); - note here that the default value for actions is "Index" - so I must have a controller called "Index" for this to work. If you don't have a default set here, it won't know where to do.
Sohnee
2009-10-09 08:58:14
default route is already there, ah maybe its a bug ? its Preview 2 anyway ..
2009-10-09 15:05:57
+1
A:
Right click on the project and select properties. Under web set the Start Action to Specific Page and then select the desired page.
Nissan Fan
2009-10-08 20:07:41
Ok, I set the Start URL to http://localhost:[PORT]/home/ and it works. It just weird that this happen only to this release. ASP.NET MVC 1 working just fine :)
2009-10-09 01:46:19
It depends on what file you have open for editing at the time that you did not have a particular startup action set.
Nissan Fan
2009-10-09 16:34:42
A:
go to your project property, select Web and set the specific page to your controller or controller/specific action if you don't want to go to index by default.
Mesfin
2009-11-12 14:42:34