Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Dynamic ASP.NET MVC controller navigation assembly

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 src
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.markdown
Octocat-spinner-32 screenshot.png
README.markdown

ASP.NET MVC Controller Navigator

Overview

ControllerNavigator is an easy to use assembly you reference in your ASP.NET MVC project that will dynamically scan your MVC application at run-time and create a navigation page (Defaults to "/Navigator" but can be changed in settings).
This makes it easy to focus on your controllers and code before you may have all of your site navigation in place.
It's an alternative to changing your default route or your web projects properties for the start URL while developing.

The project was based off of Phil Haack's excellent ASP.NET Routing Debugger and I used his code as a reference for this experiment.

ControllerNavigator is not recommended for deployment on a production application, but just as a helper during development.

Usage

You will want to add a reference to the assembly and in your Global.asax, you will need to call the DisplayNavigator() method. protected void Application_Start() { AreaRegistration.RegisterAllAreas();

    RegisterRoutes(RouteTable.Routes);

    //for optional settings, use the NavigationSettings class prior to calling DisplayNavigator()
    ControllerNavigator.Navigator.DisplayNavigator(RouteTable.Routes);
}

Screenshot

screenshot of ControllerNavigator

Future

  • clean up reflection code
  • add some dynamic features to pull any standard parameters (string, int, etc) from your ActionMethods and allow you to enter data in on the navigation page.
  • handle cases where there may be multiple ActionMethods with the same name, but alternate signatures
  • add more details about the controller. Display non-filtered ActionFilters in a column.
  • weigh the pros/cons of the System.Web.Mvc reference for the custom ActionFilter.
  • add unit tests
  • do more testing in general

Source

Feel free to fork/download/whatever. I'd appreciate any feedback or questions you have. If I could be handling the reflection a lot easier, drop me a line with ideas. (find me on twitter http://twitter.com/adammokan)

The included sample MVC project will show the usage with settings options in Global.asax

Requirements (What I tested on)

  • .NET Framework 4.0
  • ASP.NET MVC 2
  • Visual Studio 2010
Something went wrong with that request. Please try again.