Copied to clipboard

Flag this post as spam?

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


  • Anton Oosthuizen 192 posts 470 karma points
    Nov 19, 2014 @ 12:04
    Anton Oosthuizen
    0

    Model State Lost

    Hi All

    My Setup

    I'm using Umbraco 7.2 Beta

    Senario

    I have an UmbracoTemplatePage lets call it PAGE injecting all the child nodes via RenderTemplate

         foreach (var page in dn.Children)
                {
    
                        @MvcHtmlString.Create(umbraco.library.RenderTemplate(page.Id));
    
                }
    

    One of the child pages has a form which gets posted to a Surface controller

    which in turn gets returned via umbracoCurrentPage()

    All is well when and the page is returned and the Modelstate is persisted in the templatepage page but because I call the child form via the code above the ModelState will be lost as soon as my form gets rendered.

    My Question

    Is there a better way of injecting child nodes? If not what do you guys suggest as a work around in persisting the modelstate

    Thanks

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies