I have been using MVC for a while now and am quite happy with it overall compared to the old ASP.NET framework. Combine it with jQuery and EF and life is good.
One thing that really annoys me about it though is all the index views I end up having. It seems every one of my controllers has an index action. So I have many views named “Index” and find it hard to keep track of them in the IDE. It is not uncommon to have multiple tabs open with “Index.cshtml”, I have no idea what controller it belongs to without hovering over the tab. It gets confusing quick. The same thing ends up happing with Create, Update, Delete actions that are common to a lot of controllers.
Maybe I should include the controller name in the views, to help keep them straight? Curious what others are doing to avoid this problem.
I have the same problem and in the true “Convention over configuration” style, I’ve come up with my own convention to use the Controller + Action name for my views.
I use spark, so this was a case of writing a custom descriptor or with Razor, you write a custom view engine that extends from the default RazorViewEngine and build your conventions in there. This article gives you an idea of how to do it.
That way I can have the Index action in the Account controller called AccountIndex.spark (or .cshtml) and I can still return View() or PartialView() from my action without having to specify the view name.