Typically, to add a command to context menus, you do the following:
Tools | Customization
On the “Toolbars” tab, check the box next to “Context menus” - this will add a new toolbar to your IDE with buttons for editor context menus, class context menus, debugger context menus, etc.
Then go to the “Teams” tab, select the desired command and drag it to the appropriate menu, and everything will be ready - in this case, select “View” in the left pane, and then to the right, scroll down until you reach “View markup”.
In this case, I can add a button to the context menu for the code editor, but it is inactive and unusable - I think it needs some kind of context that it receives from the Solution Explorer, t get from the code window - which is odd, because it pulls the same details for the "View Designer" and "View Code".
I think I would use Shift + F7, and then, sorry.
source share