Freigeben über


Tip #67: Did you know the list of ASP.Net MVC shortcuts?

Add Controller (Ctrl-M Ctrl-C)

Add Controller is a simple dialog box that lets you quickly add controllers to ASP.Net MVC Applications. Right-Click the 'Controllers' folder or simply press Ctrl-M Ctrl-C to invoke this dialog.

AddControllerDialog

Add View (Ctrl-M Ctrl-V)

The Add View is the easiest way to add views to an ASP.Net MVC Application. Right-Click from within an Action Method or in solution explorer, or simply press Ctrl-M Ctrl-V to invoke the dialog. The shortcut is especially effective when invoked inside an action method.

AddViewDialog

Go to View / Go to Controller (Ctrl-M Ctrl-G)

Once you have added controllers with Action Methods and corresponding views, navigate between them with the 'Go To View...' and ‘Go to Controller…’context menu items. These menu items can be invoked in an Action Method of a controller or in the markup of an ASP.Net MVC View Page. Anywhere a menu item is visible you can instead navigate within your ASP.Net MVC Application by simply pressing (Ctrl-M Ctrl-G) to move to the corresponding view or controller.

GoToViewMenu

 

Hope this makes ASP.Net MVC development easier!

Joe Cartano | Visual Web Developer

Comments

  • Anonymous
    May 31, 2009
    PingBack from http://microsoft-sharepoint.simplynetdev.com/tip-67-did-you-know-the-list-of-aspnet-mvc-shortcuts/

  • Anonymous
    May 31, 2009
    Thank you for submitting this cool story - Trackback from DotNetShoutout

  • Anonymous
    May 31, 2009
    Thank you for submitting this cool story - Trackback from progg.ru

  • Anonymous
    June 01, 2009
    Go To View does not seem to work, when the ActionName attribute is used and the method name is different from the view name...

  • Anonymous
    June 01, 2009
    @Renka You are right, this is a limitation of MVC 1.0. We are considering improving the behavior in a future release. Joe Cartano

  • Anonymous
    January 17, 2011
    After you install newer versions of MVC it somehow stops working. I had MVC2, it worked, then installed MVC3 betta, stopped working. Now I have MVC3 release and still not working and havent found a way to have this working back again. Any help is appreciated. Thanks.

  • Anonymous
    February 14, 2012
    I got this working with the help of stackoverflow.com/.../shortcut-keys-not-working-visual-studio-2010-with-asp-net-mvc-3-rc1