Using older asp pages you could view the code behind pressing the F7 key. This short cut does not work for VS17/19.
I have tried some of the suggestions "Visual Studio hotkey to switch between code behind and source file?" that did not work.
This is driving me crazy, and I know that it is a very simple fix, but i cannot find anything on the web about it.
So the goal
Press F7 or other function key to view the cshtml.cs file for the associated .cshtml file.
There is a command available to do this for Razor Pages. It does not work for all .cshtml files (i.e. MVC views).
You can bind the command by configuring it in the Keyboard options. The command is called ProjectandSolutionContextMenus.Item.ToggleRazorView (not the most intuitive, I know). In the screenshot, I've already bound it to the F7 key:

(note: this was previously reported through Developer Community (also sometimes called VS Feedback), which is a great way to make sure your feedback reaches the product team.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With