I've been pulling my hair out trying to find examples of getting a custom MVC 5 route to work with Umbraco 7.5.2. All documentation I see references using Umbraco data, but I need to get a custom Orders admin with CRUD to play in the same Umbraco site, while completely ignoring Umbraco altogether.
I get an Umbraco 404 when loading anything within /Views/Orders/. I have added this folder to umbracoReservedPaths in Web.config.
Controller:
public class OrdersController : Controller
{
private OrdersContext db = new OrdersContext();
// GET: Orders
public ActionResult Index()
{
return View(db.OrdersDb.ToList());
}
}
RouteConfig:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Orders",
"orders/{action}/{id}",
defaults: new { controller = "Orders", action = "Index", id = UrlParameter.Optional }
);
}
Custom route *not* using the Umbraco pipeline
Greetings,
I've been pulling my hair out trying to find examples of getting a custom MVC 5 route to work with Umbraco 7.5.2. All documentation I see references using Umbraco data, but I need to get a custom Orders admin with CRUD to play in the same Umbraco site, while completely ignoring Umbraco altogether.
I get an Umbraco 404 when loading anything within /Views/Orders/. I have added this folder to umbracoReservedPaths in Web.config.
Controller:
RouteConfig:
Global.asax.cs:
The class type for Application_Started() is UmbracoApplication... not sure if that makes a difference. Thanks in advance for any help!
Scott
is working on a reply...