Is there some technical explanation available for the apparent restriction upon the use of "code blocks" within pages containing the RadUpload control?
I have a VB.NET application in development using the RadUpload control. The application uses a Master Page design, with the usual Content Placeholder control to render in variable "child-page" content. One of the child-pages contains a RadUpload control.
I needed to add some client-side javascript for other child-page processes completely unrelated to the RadUpload control. That client-side javascript required the use of a .NET "code block" (<%= … %>) to render-in a value from the page's code-behind script.
The client-side javascript block is a normal script block, placed in the Master Page document HEAD. And everything about it works fine across all child-pages, until I render-in the child-page containing the RadUpload control.
At that point I get an error:
"The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)"
A little poking around your site revealed, in a completely unrelated area, the restriction:
"The <%= .. %> codeblock must be placed inside the BODY element of the page."
http://www.telerik.com/help/aspnet-ajax/upload_clientsidebasics.html
The example noted was capturing the RadUpload control's ClientID, so I figured it didn't apply to me, since I wasn't messing with the RadUpload control at all.
And yet, just as noted, the page with the RadUpload control will not render until I place my script block (with that "code block" inside) within the Master page's BODY tag.
Now, I'm no stickler for "Script in the Head" and don't mind moving the script block. But I'd like to understand what's going on.
There are places in the final design where I will have at least one other 3rd Party control in my page, with its own clot of client-side script, collocated with the RadUpload control. And, like with the RadUpload control, I don't have a lot of influence over how that control and its scripting nestles into the rendered page.
So any explanation for the "code blocks in the body, please" requirement would be appreciated.
Thanks