Copied to clipboard

Flag this post as spam?

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


  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Oct 27, 2014 @ 15:56
    Tim
    0

    SurfaceControllers Don't Work When Using RouteHandlers

    I'm prototyping a site where it has several small micro-sites, each on different domains. There is also a central repository of "shared" pages that are available to each of the sites.

    I've made the shared content work by using the new RouteHandler synatx that Shannon added in 7, to route to a custom controller, with some parameters. That controller then looks for the content under the shared section, and renders on the site with the domain that the user is viewing.

    So far, this all works very well. However, I'm running ino an issue with surface controller forms. If I have a surface controller form on one of the shared pages, the surface controller actions never fire. The form submits, but the surfacecontroller doesn't get hit at all, it just reloads the page, without firing the SurfaceController action associated with the form.

    The issue is definetely to do with the pages that are being rendered using the RouteHandler syntax. If I put the SurfaceController forms on a "normal" page, then everything is routed as you would expect.

    Does anyone know what the issue might be here, I'm trying to debug it, but not having lots of luck, as there's not a whole lot of information available on how the SurfaceController actions are routed, so I'm not 100% sure where to even start looking.

    Any help or pointers greatly appreciated!

    :)

    Tim.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Oct 27, 2014 @ 17:02
    Jeroen Breuer
    0

    Sorry I can't help you with the RouteHandlers, but I did something similiar with shared pages between micro sites. The shared pages are nodes outside of the root website nodes and the routing is done with a content finder. The content finder finds the correct node and returns that. Than it will go to the correct controller and actionresult through route hijacking. Works pretty easy :-).

    Jeroen

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Oct 28, 2014 @ 11:53
    Tim
    0

    How did you handle getting the correct root for things like navigation? I was using the routehandler stuff to pass that kind of information into my controllers as parameters.

    I originally used a ContentFinder, but in order to get some stuff working I had to do some hacky stuff with ViewBag/Context Store, the RouteHandler let me include all that as Route parameters which was much more elegant, but if SurfaceControllers don't work, I can't have any forms on may pages, so I might have to go back to the ContentFinder method, as at least the SurfaceControllers work using that method!

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Oct 28, 2014 @ 12:05
    Jeroen Breuer
    0

    What kind of info do you need to pass as parameters? Based on the url I had enough info to know what node to return. I stored extra data on the node itself like on what websites the shared page was allowed.

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft