Copied to clipboard

Flag this post as spam?

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


  • Lewis Smith 211 posts 620 karma points c-trib
    Nov 27, 2019 @ 10:51
    Lewis Smith
    0

    Redirect with model from SurfaceController to RenderMvcController

    Hi all,

    How do i redirect from a SurfaceController to RenderMvcController?

    SurfaceController (named TestSurfaceController):

    public ActionResult SurfaceAction(TestModel model){
          return RedirectToAction("TestRenderMvc", "RenderAction", model);
    }
    

    RenderMvcController (named TestRenderMvcController):

    public ActionResult RenderAction(RenderModel model){
          return CurrentTemplate(model);
    }
    

    The RedirectToAction needs updating but i cant think to what?

    I get the following error when i run this:

    No route in the route table matches the supplied values.
    

    I don't particularity want to add a route specifically for this so was hoping there was a umbraco return method available to a SurfaceController.

  • Lewis Smith 211 posts 620 karma points c-trib
    Nov 27, 2019 @ 10:59
    Lewis Smith
    0

    Just found RedirectToCurrentUmbracoPage() but this only allows query strings not a model.

Please Sign in or register to post replies

Write your reply to:

Draft