Take the 2-minute tour ×

with site structure as below

site structure

and route config as

public static void RegisterRoutes(RouteCollection routes)
                name: "Default",

Then I go to http://localhost:23233, it shows me with index.cshtml in root, if i rename the root index.cshtml, it shows me index in views/home folder. I do not quite understand this. Aren't all views returned by controller? can someone explain this to me?

share|improve this question
I am intrigued. As far as I know, you have to specifically ignore root ("") requests have MVC ignore it and have it pick up the index through the regular asp.net system. Maybe you could elaborate, is the HomeController being hit at all? Or is the view called directly (as if it were an old fashioned asp.net aspx page)? –  René Wolferink Nov 19 '12 at 15:13
add comment

2 Answers

up vote 2 down vote accepted

~/Index.cshtml is a standalone Web Page, it doesn't need a controller. You can disable Web Pages using the following setting on Web.config:

share|improve this answer
add comment

Hadn't seen this before but index.cshtml and default.cshtml in the root your application will be treated as index.html and default.html used to be treated in older asp.net applications. Makes sense for folk migrating to mvc from asp.net I guess.

Reference: http://forums.asp.net/t/1577234.aspx/1

share|improve this answer
add comment

Your Answer


