23

Is there a way of quickly switching between controllers and views in Visual Studio when developing ASP.NET MVC applications?

I find that the solution explorer has quickly become very difficult to navigate through simply due to the quantity of files that is in there.

2 Answers 2

36

Answering my own question Yes there is. There appears to be a default shortcut key Ctrl-M then Ctrl-G.

This will automatically switch between the two. If you're on the controller/action it will switch to the view and vice versa.

2
  • Nice find. I never looked for it as I only have files open I work in (so Ctrl(+Shift)+Tab) works for me. I get "Unable to find matching controller" from a view, but from any action method it indeed finds the appropriate view.
    – CodeCaster
    Aug 1, 2013 at 9:42
  • Perhaps you've done something custom - maybe your view names don't match your action names or something similar? Sounds like you're more organised than me. My tab bar is usually one massive disorganised mess ;) Aug 1, 2013 at 9:54
7

Right click on the action -> go to view

1
  • 2
    There is no Go-To-View in the popup menu. How should I do?
    – James Rao
    Feb 1, 2017 at 11:52

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.