Visual Studio hotkey to switch between code behind and source file?

Visual Studio-2008

Visual Studio-2008 Problem Overview


I use the Shift + F7 often to switch between source and design view.

Does anyone know of a hotkey to switch between the source file and its code behind file, e.g. between (Default.aspx and Default.aspx.cs)?

Visual Studio-2008 Solutions


Solution 1 - Visual Studio-2008

F7

Solution 2 - Visual Studio-2008

In the VS2010 the following works:

  1. Go to: Tools > Options > Keyboard

  2. Search for "View.ToggleDesigner" in "Show Commands Containing".

  3. Add new shortcut to "Global" with F7.

Solution 3 - Visual Studio-2008

Yep just F7

Look at this poster for C# VS2008 shortcuts

You can also bind it to any combination of keys you like, go to tools, options (show all settings) environment, keybord, Show Commands for View.ViewCode and change to your liking.

Added by Rob Cooper:

For 2005 Users: Visual C# 2005 Keyboard Shortcut Reference Poster

For 2010 Users: Visual C# 2010 Keyboard Shortcut Reference Poster

Edit 08 Sept 2014

There don't seem to be posters beyond 2010 but there is a website for VS2012, VS2013 and VS14: Visual Studio Shortcuts

Solution 4 - Visual Studio-2008

For those trying to do this (switch from the code view to markup view) in VS2012, I had to go Tools > Options > Keyboard, then select

  • Keyboard Mapping Scheme as "(default)"
  • View.ToggleDesigner as the command
  • Use new shortcut in "Text Editor"
  • Set the shortcut key to F7

This results in F7 switching both ways from the markup view to the code view and vice versa.

Before doing this I had to use Shift+F7 twice to get to markup from the code view.

Solution 5 - Visual Studio-2008

In VS 2013 it is

  1. Tools > Options > Environment > Keyboard

  2. Type "View.Toggle" or "View.ToggleDesigner" (the command could be either depending on the version of VS) in Show Commands Containing:

  3. Make Sure Use new shortcut in: is set to Global

  4. Put cursor in Press shortcut keys: box

  5. Hit F7 then the Assign button

Solution 6 - Visual Studio-2008

In case F7 does not work for you, go to "Tools - Import and Export settings - Reset all settings" and choose "Web development" template to reset to.

Solution 7 - Visual Studio-2008

Just drop the shift key, it's just F7.

Solution 8 - Visual Studio-2008

When in code view use shift-F7 to get to the designer. When in the designer use F7 to get back to code.

Solution 9 - Visual Studio-2008

Try Ctrl + PageUp to toggle between design view and code behind.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionEdward TanguayView Question on Stackoverflow
Solution 1 - Visual Studio-2008splattneView Answer on Stackoverflow
Solution 2 - Visual Studio-2008Eduardo CuomoView Answer on Stackoverflow
Solution 3 - Visual Studio-2008KeesDijkView Answer on Stackoverflow
Solution 4 - Visual Studio-2008James GView Answer on Stackoverflow
Solution 5 - Visual Studio-2008DanView Answer on Stackoverflow
Solution 6 - Visual Studio-2008Alex from JitbitView Answer on Stackoverflow
Solution 7 - Visual Studio-2008Cristian LibardoView Answer on Stackoverflow
Solution 8 - Visual Studio-2008Hans KarlsenView Answer on Stackoverflow
Solution 9 - Visual Studio-2008dotnetcoderView Answer on Stackoverflow