0

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 request that doesn't seem to go through the routing engine. This is when I'm running it from visual studio, I haven't yet tried deploying to IIS.

1
  • 1
    My app needs the default.aspx when I run the site locally in development but on the server I can safely delete the file, could it have something to do with IIS? I do not run the app locally with IIS. Commented Nov 12, 2009 at 17:41

4 Answers 4

1

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

Sign up to request clarification or add additional context in comments.

Comments

0

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

3 Comments

What do you need it for anyway?
It was only there to anchor the default request (myurl.com)in ASP.NET. They must have figured out a way to eliminate it.
This is not entirely true. In most cases your routes will map to a page/view.
0

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

4 Comments

I've checked the routes and they are fine, its the template project I'm trying to run with no changes
did you delete any of the default views or other files that come along with it?
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.
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?
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.