Does RadUpload not work in a user control (.ascx)? CaseFile.UploadedFiles.Count is always 0. Any help would be greatly appreciated. KR
Code Behind
.ASCX
Code Behind
protected void AttachmentCase_AddClick(object sender, EventArgs e){ CaseAgentActions.CaseOpenFile attachment = new CaseAgentActions.CaseOpenFile(); // Attach the file referenced to upload. if (CaseFile.UploadedFiles.Count > 0) { foreach (UploadedFile item in CaseFile.UploadedFiles) { attachment.Filename = item.FileName; byte[] attachmentBytes = new byte[item.InputStream.Length]; item.InputStream.Read(attachmentBytes, 0, attachmentBytes.Length); attachment.FileData = attachmentBytes; page.oCaseOpen.Files.Add(attachment); } } AttachmentsGrid.Rebind();}.ASCX
<telerik:RadUpload ID="CaseFile" runat="server" InitialFileInputsCount="3" MaxFileInputsCount="10" Width="400px"></telerik:RadUpload><asp:Button ID="AddFileButton" runat="server" Text="Add File" OnClick="AttachmentCase_AddClick"Width="120px" CssClass="Case_Search_Button" Font-Bold="true" Font-Size="10px"Height="20px" CausesValidation="false" />