Copied to clipboard

Flag this post as spam?

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


  • Tim 1193 posts 2655 karma points c-trib
    May 31, 2013 @ 18:12
    Tim
    0

    Bind Render Form Macro at Runtime

    Hiya,

    I'm trying to get something to work and I'm wondering if this is possible? Basically, I have a control that wraps the contour render control, and does some extra checks. I want it to pass the contour user control a property that is set on the parent user control.

    I've tried setting the macro parameter with DataBinding, and I've tried setting it on the code behind, but n both cases it comes out as empty and doesn't pick up the form value. I CAN get it to work by loading the control in the code behind, and setting the macro parameter and then adding that to the user controls controls collection. HOWEVER, that breaks one of the custom field types that the form uses that I have no source for.

    Is this actually possible with Contour?

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jun 03, 2013 @ 12:36
    Tim Geyssens
    100

    Yeah it should, basicly do the same with the Contour preview

    On init I simply add the usercontrol

     RenderForm control = (RenderForm)new UserControl().LoadControl("~/usercontrols/umbracoContour/RenderForm.ascx");

                    control.AllowEditing = true;

                    control.FormGuid = f.Id.ToString();

                    PlaceHolder1.Controls.Add(control);

    Maybe if you do it this way and not with the macro you have more luck...

  • Tim 1193 posts 2655 karma points c-trib
    Jun 05, 2013 @ 16:00
    Tim
    0

    Tim, you're a star :) that worked! Thanks for the pointer!

  • 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