Copied to clipboard

Flag this post as spam?

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


  • Tom Bruce 122 posts 506 karma points
    Jul 31, 2017 @ 11:01
    Tom Bruce
    0

    Display another View after user has submitted their details

    I am trying to display a success View after the user has submitted their details within another View. I have placed a breakpoint at the action.

    The action is called but the success View is never displayed!!! Code below;

    public class ApplicantController : SufaceController
    

    { public ActionResult SubmitApplicatForm(ApplicationViewModel model) { if (ModelState.IsValid) { _applicantHelper.Create(model); }

        return RedirectToAction("RenderSuccess", "Home");
    }
    

    } public class HomeController : SurfaceController { public ActionResult RenderSuccess() { return View("Success"); } }

    @using (Ajax.BeginForm("SubmitApplicatForm", "Applicant", null, new AjaxOptions
    

    { HttpMethod = "POST", })) {

    @Html.AntiForgeryToken()

    @Html.LabelFor(m => m.Forename) @Html.TextBoxFor(m => m.Forename, new { @class = "form-control" })
    @Html.LabelFor(m => m.Surname) @Html.TextBoxFor(m => m.Surname, new { @class = "form-control" })

    }

  • Sven Geusens 169 posts 881 karma points c-trib
    Aug 01, 2017 @ 18:42
    Sven Geusens
    100

    Hey Tom, I have never tried to use the umbraco surface forms logic in combination with ajax calls, but this is a good piece of documentation on the umbraco surface forms logic https://our.umbraco.org/documentation/reference/templating/mvc/forms

    Hope it helps.

Please Sign in or register to post replies

Write your reply to:

Draft