tags:

views:

236

answers:

4

I just installed the ASP.Net MVC Preview 2 so I can have a look at some of the new features.

However when I create a new MVC 2 project it creates everything but default.aspx, is this a bug or is this handled differently in version 2 to version 1? When I run the project it just takes me to the directory listing, I assume I could just copy one from an MVC 1 project?

Edit

Just to update, if I add a default.aspx to the project with the following line in its page load then the application works fine

Response.Redirect("Home/Index");

It's just the initial route reuqest that doesnt seem to go through the routing engine. This is when I'm running it from visual studio, I havent yet tried deploying to IIS.

A: 

You don't use Default.aspx for MVC. There is no 1 to 1 mapping of URLs to files.

blockhead
It was always there in MVC 1
Gavin Draper
What do you need it for anyway?
blockhead
It was only there to anchor the default request (http://myurl.com)in ASP.NET. They must have figured out a way to eliminate it.
Robert Harvey
This is not entirely true. In most cases your routes will map to a page/view.
Chuck Conway
A: 

It is not supposed to be there in ASP.NET MVC 2, you might want to check your default routes though.

NickLarsen
I've checked the routes and they are fine, its the template project I'm trying to run with no changes
Gavin Draper
did you delete any of the default views or other files that come along with it?
NickLarsen
no everything is untouched, I've tried creating it again. When I run the project from visual studio it just goes straight to the directory listing. MVC 1 projects seem to work fine.
Gavin Draper
Im not sure what the problem is then, I might try deleting that one if you havent made any changes and trying to create a new one. What is the url it is trying to go to?
NickLarsen
A: 

Default.aspx is typically the default page out of the box in IIS and will conflict if not override your routing in MVC. If you need a "default" page use "Index.aspx."

Out of the box /Home/Index is the default page/route, of course you can change this in the Global.asax

Chuck Conway
A: 

Have updated to the latest version of ASP.Net MVC 2 and the problem went a way. So I guess either something went wrong with my install or there was a problem with that version

Gavin Draper