Copied to clipboard

Flag this post as spam?

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


  • OleP 67 posts 276 karma points
    Mar 03, 2017 @ 15:50
    OleP
    0

    Asynchronously loading form sets wrong action path

    Hi all,

    I'm currently doing a project, where my client want to be able to open modal windows with the content of child nodes.

    This works fine on regular content, but I'm facing an issue when the child node contains a form picker. The form loads fine, but the action path is set to the surface controller path, rather than the path of the node containing the form.

    I use a very simple controller, returning a partial view and an IPublishedContent based on node id and partial name:

            public ActionResult GetContentById(int contentId, string partialPath)
        {
            if (contentId > 0)
            {
                IPublishedContent content = Umbraco.TypedContent(contentId);
    
                if (content != null)
                {
                    return PartialView(partialPath, content);
                }
                else
                {
                    return CurrentUmbracoPage();
                }
            }
            else
            {
                return CurrentUmbracoPage();
    
            }
        }
    

    This might be a general MVC question, but what's the best practice when loading a form asynchronously? The form picker is located in the grid as an leblender editor, if that makes any difference.

    I should probably modify the form, so it posts asynchronously aswell?

    Have anyone faced similar challenges, or can point me in the right direction at least?

    Thanks!

Please Sign in or register to post replies

Write your reply to:

Draft