Copied to clipboard

Flag this post as spam?

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


  • Anthony Southworth 46 posts 173 karma points
    Mar 19, 2012 @ 16:58
    Anthony Southworth
    0

    Widget using RenderTemplate does not display TextBox in a User Control

    I've followed the Render Template widget tutorial and have had no problems creating static widgets. When I've tried to use a contact form usercontrol in a widget it has rendered the first label tag but then cut out when the first textbox was hit.

    The contact form usercontrol works when referenced from a template and when placed in a standard page RTE. 

    The contact form also renders when a <form runat="server"> tag is wrapped around it, but this causes errors on postback.

    Any help much appreciated.

    Tony

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Mar 19, 2012 @ 17:37
    Lee Kelleher
    0

    Hi Tony,

    Not too sure what it might be, I'll try to reproduce the problem later.  I'm sure I've had widgets using <form runat=server> before... but will double-check.

    Thanks, Lee.

  • Anthony Southworth 46 posts 173 karma points
    Mar 19, 2012 @ 18:12
    Anthony Southworth
    0

    Looking into it further, the widget works when the there's a form tag in the widget, and the form from the master page is removed.

    This means that there can't be any other forms on the page, which is a problem.

    Thanks,
    Tony 

     

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Mar 19, 2012 @ 20:48
    Lee Kelleher
    0

    Hi Tony,

    That does make sense, in that the underlying RenderTemplate call (which is Umbraco core functionality) uses Server.Execute to render the node/template (e.g. widget) ... which means that it is effectively its "own" page.  So on its own the server-side form tag is fine, but once the HTML (string) is taken and embedded into the parent/container page/template, there are multiple/nested form tags ... so no good.

    I can't recommend a workable solution using RenderTemplate, unless you can do away with using WebForm controls inside the widget? (Throwing back to classic POST / Request object?)

    - Lee

  • Anthony Southworth 46 posts 173 karma points
    Mar 20, 2012 @ 10:50
    Anthony Southworth
    1

    Thanks for looking into this Lee.

    I've used the macro from this article: http://blog.hendyracher.co.uk/sidebar-widgets-with-umbraco-v4/ to replace RenderTemplate.

    Cheers
    Tony 

Please Sign in or register to post replies

Write your reply to:

Draft