Copied to clipboard

Flag this post as spam?

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


  • Pathini 15 posts 105 karma points
    Nov 04, 2024 @ 13:02
    Pathini
    0

    how to pass model values to partialview form surfacecontroller post action

    I'm extending umbraco site using locally declared surfacecontrollers and forms. on submit form I have some server side validations and return to form with errors. I'm rendering view using macro using code below,

     @await Html.PartialAsync("~/Views/Partials/myicForms/RegisterForm.cshtml",new RegisterFormViewModel())
    

    Requirement - Enter email do a validation on controller and then load view with different form then step 2 enter rest of the details and submit again. how do I pass entered values back to form rather than passing empty model?

    I tried returrn CurrentUmbracoPage() and rerturn RedirectToCurrentUmbracoPage() and TemData but failed to load values to input fields . I can pass error using TempData but I cannot pass entered form values back. any idea how to sort this ?

  • Dhanesh Kumar MJ 165 posts 521 karma points MVP c-trib
    Nov 05, 2024 @ 08:38
    Dhanesh Kumar MJ
    0

    Hi Pathini,

    I recommend checking out this blog on creating multi-step forms using a SurfaceController. Although it’s an older post, it provides valuable insight into implementing multi-step forms in Umbraco and can help you understand the overall concept.

    There is another in forum itself checkout this also - Multi-step-form-implementation

    For enhanced UI transitions, you might consider using JavaScript plugins designed for multi-step forms. Here are some lightweight options:

Please Sign in or register to post replies

Write your reply to:

Draft