Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 18th, 2012  |  syntax: None  |  size: 0.77 KB  |  hits: 5  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Controller in separate assembly and routing
  2. public class ShinnyController : Controller
  3. {
  4.     [HttpGet]
  5.     public string Index()
  6.     {
  7.         return "Hello, from Awesome.Mvc.Lib";
  8.     }
  9. }
  10.        
  11. routes.MapRoute(
  12.         name: "Default",
  13.         url: "{controller}/{action}/{id}",
  14.         defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
  15.         namespaces: new [] { "Slick.App.Controllers" }
  16.     );
  17.        
  18. new [] {"Namespace1", "Namespace2"}
  19.        
  20. var myRoute  = routes.MapRoute(
  21.         name: "Default",
  22.         url: "{controller}/{action}/{id}",
  23.         defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
  24.         namespaces: new [] { "Slick.App.Controllers" }
  25.     );
  26.  
  27. myRoute.DataTokens["UseNamespaceFallback"] = false;