Copied to clipboard

Flag this post as spam?

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


  • Christian Dalager 6 posts 26 karma points
    Feb 11, 2011 @ 10:02
    Christian Dalager
    0

    Code block issue: Only "previous" and "next" buttons when rendering Contour form.

    When I try to render a Contour form placed in a Rich Text Editor field, only prev and next buttons appear.

    I have <form runat=server> around the form.

    The form is an exact copy of the Contact form template

    I have tried 

    <umbraco:Item ID="Item2" Field="content" runat="server" />

    I have tried to render the form directly in the template with 

    <umbraco:Macro ID="Macro1" runat="server" 
      Alias="umbracoContour.RenderForm" 
      FormGuid="1f5b4989-2864-4762-b38c-8a071cb17679" />

     

    Finally found out by tracing the page with ?umbDebugShowTrace=true that the problem is a code block:

    Error adding macro Insert form from Umbraco Contour
    The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
      at System.Web.UI.ControlCollection.Add(Control child)
      at Umbraco.Forms.UI.Usercontrols.RenderForm.RenderUi() in 

    As Umbraco.Forms.UI.dll is obfuscated I can't see why this is a problem.

    Is the only solution to go through my site and convert all codeblocks to usercontrols?

    Isn't this a bug?

     

    I'm running 4.6.1 and Contour 1.1.5

     

  • Comment author was deleted

    Feb 11, 2011 @ 12:13

    Hi Christian,

    Could you shed some light on the code blocks that you have on your template?

  • Christian Dalager 6 posts 26 karma points
    Feb 11, 2011 @ 14:40
    Christian Dalager
    0

    Hi Tim

    I've been removing code bit by bit and finally found the culprit: It was SquishIt who did it!

    http://www.codethinked.com/post/2010/05/26/SquishIt-The-Friendly-ASPNET-JavaScript-and-CSS-Squisher.aspx

    <%= Bundle.JavaScript()
                  .Add("~/scripts/jquery.min.js")
                  .Add("~/scripts/cufon-yui.js")
                  .Add("~/scripts/Nobile_250.font.js")
                  .Add("~/scripts/Barmeno_400-Barmeno_700.font.js")
                  .ForceDebug().Render("~/scripts/scripts_#.js")
    %>    

    I guess I'll go on without squishing for now.

    Any idea why this breaks?

     

    /christian

     

     

  • Comment author was deleted

    Feb 11, 2011 @ 15:00

    Well guess it breaks since it's a code block, will do some tests and see if we can avoid this error in a future release.

     

  • Christian Dalager 6 posts 26 karma points
    Feb 11, 2011 @ 15:03
    Christian Dalager
    0

    The strange part is that its not a block but a <%= "stringbaby" %> stringything. And that kind of string writing is not a problem with Contour in general, it seems.

    Have a nice weekend :)

  • Mirela Budaes 44 posts 94 karma points
    Nov 21, 2012 @ 17:39
    Mirela Budaes
    0

    In case someone runs into this problems, the fix for me was to do put the squishit calls into a razor script and reference it from the master page.

    <umbraco:Macro runat="server" FileLocation="~/macroScripts/Shared/BundleStaticFiles.cshtml"/>
    @using SquishIt.Framework
    
    @Html.Raw(Bundle.Css()
                    .Add("~/css/normalize.css")
                    .Add("~/css/style.css")
    
                    .Render("~/css/min/combined_#.css"))
Please Sign in or register to post replies

Write your reply to:

Draft