Copied to clipboard

Flag this post as spam?

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


  • JamesW 18 posts 128 karma points
    Mar 05, 2019 @ 10:27
    JamesW
    0

    Passing model data on through 3 pages

    I have 3 pages for the user to book tickets:

    Details page (select the no of tickets) Review page (confirm total cost and tickets) Payment page (enter personal and payment details)

    I need to pass a custom model from the details page on to the next, is it possible to do it this way or would I have to use sessions/TempData to achieve this?

    I've got the custom model working and have tried using partial views with the forms, i've also had a custom controller working but still struggle to pass the model between the pages.

  • Ole Martin Bakke 112 posts 624 karma points
    Mar 05, 2019 @ 18:00
    Ole Martin Bakke
    100

    Have you looked into SurfaceControllers? You should be able to persist data by posting a form through a surfacesontroller on each page.

    https://our.umbraco.com/documentation/reference/routing/surface-controllers

  • JamesW 18 posts 128 karma points
    Mar 06, 2019 @ 09:18
    JamesW
    0

    Hi Ole

    Thank you for your reply.

    Yes I pretty much have it working now using SurfaceControllers, but I ideally wanted the forms across 3 different URLs which I’ve been struggling to achieve and only seem to be able to pass the model to a partial view from the controller. But I guess this way will have to do.

  • 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