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.
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.
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?)
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
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.
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
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
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
is working on a reply...