Copied to clipboard

Flag this post as spam?

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


  • Robert 21 posts 122 karma points
    Aug 24, 2016 @ 12:13
    Robert
    0

    The name 'CurrentTemplate' does not exist in the current context

    HI, there; I am very new to this Umbraco. I am creating my own controller.

     I am getting compile error: The name 'CurrentTemplate' does not exist in the current context.
    

    My Umbraco version is 7.4.

    It seems I am missing some name space or reference.

    Can someone help this please?

    Cheers Robert.

  • Marc Goodson 2157 posts 14435 karma points MVP 9x c-trib
    Aug 24, 2016 @ 17:06
    Marc Goodson
    100

    Hi Robert,

    Make sure your controller inherits from RenderMvcController in Umbraco.Web.Mvc,

    then you will have access to the CurrentTemplate ActionResult helper to use from your hijacked controller.

    regards

    Marc

  • Robert 21 posts 122 karma points
    Aug 25, 2016 @ 10:32
    Robert
    0

    Thanks Marc. It works!

    Originally I inherit from SurfaceController

    Cheers Robert

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies