Copied to clipboard

Flag this post as spam?

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


  • Jeremy 8 posts 29 karma points
    Oct 10, 2011 @ 16:16
    Jeremy
    0

    does not implement IController

    I get this error when adding the macro to the page -

    Error loading Razor Script MvcRenderAction.cshtml
    The controller for path '/umbraco/macroResultWrapper.aspx' was not found or does not implement IController

     

    Everything seems to be inheriting properly in code... I'm not where the problem is.

  • Jeremy 8 posts 29 karma points
    Oct 10, 2011 @ 16:54
    Jeremy
    0

    Looks like I was just being stupid.

    The path in my xcopy post build command was mis-spelled. =]

    I am getting a null object reference now, but It's probably something I overlooked.

  • Jeremy 8 posts 29 karma points
    Oct 10, 2011 @ 17:36
    Jeremy
    0

    fyi - The null object reference was a missing connection string for my Linq to SQL DBModel context.

     

    Great job on this project! You really have saved me some time!

  • Richard Boelen 61 posts 153 karma points
    Oct 12, 2011 @ 08:38
    Richard Boelen
    0

    Great to hear !

    Cheeers,

    Richard

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Jul 07, 2012 @ 15:03
    Sebastiaan Janssen
    0

    Hmm, I get the same thing. The node in Umbraco it /getquote/, error:

     

    Error loading Razor Script MvcRenderAction.cshtml
    The controller for path '/getquote/' was not found or does not implement IController.

    Macro (in quote.master):
    <umbraco:Macro action="Index" controller="Quote" formtoken="QuoteForm" Alias="MvcRenderAction" runat="server"></umbraco:Macro>

    Controller:

    using System.Web.Mvc;
    
    namespace Umbraco.Web.Controllers
    {
        public class QuoteController : Controller
        {
            [HttpGet]
            public PartialViewResult Index()
            {
                return PartialView();
            }
        }
    }

    I must be missing something obivious, but I can't see it.. ?

    Is it me trying to use MVC4? I'll try to recompile against 4 and see if that helps. 

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Jul 07, 2012 @ 15:45
    Sebastiaan Janssen
    0

    Yup, that was it. Had to change this one:

    AntiForgery.Validate(parentContext.HttpContext, antiForgeryToken);

    to just:

    AntiForgery.Validate(); 

    The other method had been deprecated. Other than that, I just installed the Microsoft.AspNet.Mvc nuget package into the source, changed this line an built. Done!

    No idea what the impact is of the Validate() change. I'm posting to a different controller through an ajax request. That one is properly routed so calling a "pure" (non-bridged) mvc action.

    Nice package Richard!

  • Richard Boelen 61 posts 153 karma points
    Jul 08, 2012 @ 11:15
    Richard Boelen
    0

    Hi Sebastiaan,

    Cool, I didn't test this stuff with MVC 4, anyway, the AntiForgery.Validate that I used checks if the request contains the same token as the one you specified in the umbraco macro. If so, then it's a valid post else I use the get.

    So in the case of 2 macro's with each it's own form, the correct form will get the postback the other will just do a get.

    I your case, you will always be using the get method on the controller.

    Cheers,

    Richard

Please Sign in or register to post replies

Write your reply to:

Draft