The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
<script type="text/javascript"> |
function pageLoad() |
{ |
var upload = $find("<%= RadUpload1.ClientID %>"); |
var uploaduploadDiv = upload.get_element(); |
var input = document.createElement("input"); |
input.type = "submit"; |
input.className = "ruButton"; |
input.value = "Submit"; |
inputinput.id = input.name = upload.getID("submit"); |
//the UL element of the upload |
var ul = uploadDiv.getElementsByTagName("UL"); |
//the array of all LI elements of the UL element |
var LIs = ul[0].getElementsByTagName("LI"); |
//Last LI item - the button area |
var lastLi = LIs[LIs.length - 1]; |
lastLi.appendChild(input); |
} |
</script> |
15 Answers, 1 is accepted
Please make sure that you have placed the javascript code outside the <head> tag on the page.
Also, you can try surrounding the javascript code with RadScriptBlock.
Kind regards,
Veselin Vasilev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I have created a sample page demonstrating how to achieve that. Please download it and give it a try.
I hope this helps.
Sincerely yours,
Veselin Vasilev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Which is the exact control that you use - RadUpload or RadAsyncUpload?
Regards,
Helen
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
I believe that it is possible, have you tried the approach suggested by Veselin Vasilev?
Regards,
Genady Sergeev
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
I am attaching sample project demonstrating how to achieve that functionality when RadUpload is inside RadGrid. The project is attached to this replay.
All the best,
Genady Sergeev
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
<telerik:GridTemplateColumn HeaderText="Product Description" UniqueName="Description">
<ItemTemplate>
<asp:MultiView ID="MultiViewType" runat="server">
<asp:View ID="ViewTextBox" runat="server">
<telerik:RadEditor ID="RadEditorDescription" runat="server" Content='<%# Eval("ProductSpecificationDescription") %>'
ContentFilters="FixUlBoldItalic, MozEmStrong, ConvertFontToSpan, ConvertToXhtml, FixEnclosingP"
EditModes="Design" ToolsFile="~/App_Data/LimitedTools.xml"
Width="275px" Height="150px"
ContentAreaCssFile="~/App_Themes/EditorContentAreaStyles.css"
AllowScripts="False">
</telerik:RadEditor>
</asp:View>
<asp:View ID="ViewLabel" runat="server">
<asp:Label ID="LabelColors" runat="server" Text='<%#Eval("ProductSpecificationDescription") %>'></asp:Label>
</asp:View>
<asp:View ID="ViewFileUpload" runat="server">
<asp:Label ID="LabelCurrentFile" runat="server"></asp:Label>
<telerik:RadUpload ID="RadUploadFile" runat="server"
OverwriteExistingFiles="true" InitialFileInputsCount="1"
ControlObjectsVisibility="None" InputSize="40">
<Localization Select="Browse" />
</telerik:RadUpload>
<asp:Button ID="ButtonUpload" runat="server" Text="Upload" CommandName="FileUpload" />
</asp:View>
</asp:MultiView>
</ItemTemplate>
</telerik:GridTemplateColumn>
Please find attached the modified project. Hope it helps.
Best wishes,
Helen
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Our button has a "CommandName' too.
Do you experience any problem with this implementation?
If yes - could you please open a support ticket and send us a sample which demonstrates the issue to examine it locally?
Kind regards,
Helen
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
I've updated the sample with the desired functionality. You can find it as an attachment.
Regards,
Genady Sergeev
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.