1

I am making a documentation for the OSS I am about to publish. The url is going to be like /Documentation/{class name} . All the documentation view are named as {namespace}_{classname}. Basically i wonder if there is a way to direct all requests to /Documentation/* to a method inside my Documentation controller so that i can do something like

return View({class name}); 

instead of having to make a method for each class

Steve
  • 11,696
  • 7
  • 43
  • 81
  • possible duplicate of [IIS URL Rewrite ASP](http://stackoverflow.com/questions/20642625/iis-url-rewrite-asp) – steve cook Nov 20 '14 at 06:24

1 Answers1

0

You can handle that in routing.

routes.MapRoute(
       "Docs",                                              // Route name
       "Documentation/{className}",                           // URL with parameters
       new { controller = "Documentation", action = "Show", className = "" }  // Parameter defaults
 );

That assumes of course that you have a DocumentationController with a Show attribute.

Paul
  • 35,689
  • 11
  • 93
  • 122