Using ASP.NET MVC3, I created a new Razor view and gave it the same name as the existing .aspx view I used. I noticed that the controller continued to look up .aspx (which has the same name as the action), which pretty much matches what was expected. Then I renamed the .aspx view and the action, getting the razor.cshtml view.
So, if I have two views, called myview.aspx and myview.cshtml, and an action called MyView () that returns return View (), it will display the view myview.aspx and return it.
How did MVC3 decide which view type to use by default? Is there a way to change this default behavior to prefer a razor view over the .aspx view?
source share