Submit form of partial inside partial with surfacecontroller

hi, I have surface controller and partial inside partial with a form. form submit does not hit the coding for action insode controller. and the submit button click redirect browser to surface/controller/….

How to fix this with out ajax call ?

I have tried return redirect(/pageurl/?xxxxxx) or return currentumbracopage() does not work.

Do you have some code so we could take a look at?

Just tried to set this up in my scratchpad solution and it seems to work.

I’ve added a simple surface controller and two partials - one called Outer one called Inner.

Test page has

@await Html.PartialAsync("TestOuterPartial/TestOuterPartial")

This is

@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage

<h2>Hello world from the outer partial </h2>

@await Html.PartialAsync("TestInnerPartial/TestInnerPartial")

Which renders:

@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage

<h2>Hello world from the INNER partial </h2>

@using (Html.BeginUmbracoForm<MySurfaceController>("HandleSubmit"))
{
	<input type="submit" />
}

And the surface controller -

public class MySurfaceController : SurfaceController
{
    public MySurfaceController(
        IUmbracoContextAccessor umbracoContextAccessor,
        IUmbracoDatabaseFactory databaseFactory,
        ServiceContext services,
        AppCaches appCaches,
        IProfilingLogger profilingLogger,
        IPublishedUrlProvider publishedUrlProvider)
        : base(umbracoContextAccessor, databaseFactory, services, appCaches, profilingLogger, publishedUrlProvider)
    {
    }

    [HttpPost]
    [ValidateUmbracoFormRouteString]
    public IActionResult HandleSubmit()
    {
        return RedirectToCurrentUmbracoPage();
    }
}

Seems to render the form correctly and hitting submit redirects back to the page… what is different from what you have?