Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sean Håkansson 67 posts 193 karma points
    Feb 12, 2019 @ 18:00
    Sean HÃ¥kansson
    0

    RenderMvcController and constructor?

    It seems my constructor is never called, I'm I doing something wrong? I got it working in a surfacecontroller, should I just use that instead?

    Code example:

    ExampleController : RenderMvcController{
      private readonly IExampleService exampleService;
    
      public ExampleController(IExampleService exampleService){
        this.exampleService  = exampleService;  
      }
    
      public override ActionResult Index(RenderModel model){
        return base.Index(createobjectmodel);
      }
    }
    

    Thanks!

  • David Challener 80 posts 444 karma points c-trib
    Feb 12, 2019 @ 23:04
    David Challener
    0

    Hi Sean,

    What are you trying to achieve?

    If this is for route hijacking then there is some good documentation on that here https://our.umbraco.com/documentation/Reference/Routing/custom-controllers

    For some general reading around the different types of controllers that can be found here https://our.umbraco.com/documentation/Implementation/Controllers/

    Hope this gives you a starting point.

    David

Please Sign in or register to post replies

Write your reply to:

Draft