If more than one index.cshtml is open in Visual Studio, I cannot determine what it is by looking at the tab. I have a cursor on the tab to see the path to recognition. Also, many times I can determine just by looking at viewbag.title
or the rest of the code.
When registering in TFS, I need to check the folder name to find out which Index.cshtml I want to check.
- Pending changes, the files are listed in alphabetical order, which means that Index.cshtml will not be next to the controller file and the model file. As such, I use vs 2012, all actions, such as viewing pending changes, registering, open all the files in the right pane - the tfs explorer window, which indicates the folder structure above the useful file.
By convention in mvc, the controller is looking for a view that should be the same as the action in your controller. e.g. Index action
and Index.cshtml
.
If you want to simplify your search, try specifying some meaningful names for your view, that is, a combination of the name of the controllers and their actions. However, this will be reflected in the URLs / routes that you will need to manage accordingly in the route.config settings.
source share