Copied to clipboard

Flag this post as spam?

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


  • Alexander Mounzer 8 posts 118 karma points
    Jul 12, 2021 @ 12:43
    Alexander Mounzer
    0

    Invoking actionresult when the action is inherited by RenderMVCController

    How can I call a Controller ActionResult that inherits from RenderMVCController from the view.

    This dosen't work

    <button>
    @Html.Action("action", "controller", new { mediaNr = @Model.MediaNr})
    </button>
    

    Also tried RenderAction and also changed the controller to surfacecontroller but the routing path dosent exist.

  • Marc Goodson 2157 posts 14435 karma points MVP 10x c-trib
    Jul 14, 2021 @ 06:28
    Marc Goodson
    100

    Hi Alexander

    There is some info here about rendering SurfaceController Child Actions:

    https://our.umbraco.com/Documentation/Reference/Templating/Mvc/child-actions#creating-a-child-action

    Maybe see if you can get the example there to work.

    It's hard to know without seeing your SurfaceController where exactly the spanner is in your works!

    could be something silly like the controller not being public, or using the word controller in the Html.Action, or the model you are sending through to the surface controller doesn't match the parameter you have on your action - try using an id instead of an full media item...

    hope that helps give you a steer, sorry couldn't be more exact.

    regards

    marc

  • 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