Copied to clipboard

Flag this post as spam?

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


  • Jon 92 posts 166 karma points
    Apr 12, 2021 @ 09:28
    Jon
    0

    Multiple partials sometimes shows /umbraco/Surface/Controllername/_partialName

    Hi,

    I have written a multi step form using multiple partials in a Surface Controller using Ajax.BeginForm. it works well apart from occasionally when clicking on Next it takes the user to a unstyled page which has a URL that is pointing to the Surface controller, for example:

    /umbraco/Surface/Controllername/_partialName

    On the Main Template I call the start of the form:

     @{ Html.RenderAction("RenderForm", controllerName: "BeConstructiveSurface");}
    

    That call an ActionResult in the Surface Controller:

     public ActionResult RenderForm()
        {
            string publishedPageCulture = System.Threading.Thread.CurrentThread.CurrentCulture.Name;
            Intro model = new Intro() { VacancyFormId = CurrentPage.Id, LanguageName = publishedPageCulture, Step = "Intro" };
            return PartialView("~/Views/Partials/BeConstructiveForm/_PartialStepOne.cshtml", model);
        }
    

    Partial Step One looks like:

      @using (Ajax.BeginForm("_PartialStepOne", "BeConstructiveSurface", new AjaxOptions
    {
        InsertionMode = InsertionMode.Replace,
        UpdateTargetId = "RegSuccessDivOne",
        HttpMethod = "Post",
        OnBegin = "step1form",
        OnFailure = "enableButton"
    }))
    {
    

    It works well for about 80% of the time but other times it just displays an un-styled page.

    Any ideas on how i can improve this to prevent this from happening?

Please Sign in or register to post replies

Write your reply to:

Draft