Copied to clipboard

Flag this post as spam?

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


  • Chris Moses 3 posts 73 karma points
    Feb 01, 2016 @ 18:03
    Chris Moses
    0

    SurfaceController form in a page that has a hijacked route...

    Hi guys!

    I have an issue that I hope you can help me with. I have a hijacked route that is at the following location...

    /browse-books/catalogue/search/

    ...which is essentially a "virtual" page that is displaying a different Template in the Views folder of my project. The following page does actually exist as a node in Umbraco...

    /browse-books/catalogue/

    ...which is the top-level of our book catalogue (a full listing of titles).

    The View that is displayed under the hijacked route ("/search/") has a Html.RenderPartial command to render a partial view that contains a search form with associated SurfaceController.

    In the SurfaceController the ActionResult (on submission of the search form) has the following...

    [HttpPost]
    public ActionResult Submit(AdvancedSearch model)
    {
         return CurrentUmbracoPage();
    }
    

    ...this is only temporary, to test functionality.

    The problem I have is that the above command returns the View for the following page...

    /browse-books/catalogue/

    ...and not...

    /browse-books/catalogue/search/

    ...I assume because it not a "real" node? If I do...

    return RedirectToCurrentUmbracoUrl();
    

    ...it works fine, but I lose the model state. How can I retain the model state in this scenario?

    Many thanks for your time, Chris

  • 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