Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RouteConfig.cs file
- routes.MapRoute(
- name: "TridionPage",
- url: "{*PageUrl}",
- defaults: new { controller = "Page", action = "Page" }
- );
- routes.MapRoute(
- name: "Default",
- url: "{controller}/{action}/{id}",
- defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
- );
- Global.ascx.cs
- public class MvcApplication : System.Web.HttpApplication
- {
- ILifetimeScope BuildContainer()
- {
- var builder = new ContainerBuilder();
- builder.RegisterControllers(typeof(MvcApplication).Assembly);
- builder.UseDD4T();
- return builder.Build();
- }
- protected void Application_Start()
- {
- var builder = BuildContainer();
- DependencyResolver.SetResolver(new AutofacDependencyResolver(builder));
- AreaRegistration.RegisterAllAreas();
- RouteConfig.RegisterRoutes(RouteTable.Routes);
- }
- }
- Page Controller File
- public class PageController : TridionControllerBase
- {
- public PageController(IPageFactory pageFactor,
- IComponentPresentationFactory componentPresentationFactory,
- ILogger logger,
- IDD4TConfiguration configuration) :
- base(pageFactor, componentPresentationFactory, logger, configuration)
- {
- public override ActionResult Page(string url)
- {
- return base.Page(url);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement