Skip to main content

ASPxClientUploadControl Class

A client-side equivalent of the ASPxUploadControl control.

Declaration

declare class ASPxClientUploadControl extends ASPxClientControl

Remarks

The ASPxClientUploadControl object serves as a client-side equivalent of the ASPxUploadControl control.

UploadControl_class.png

Use the ClientInstanceName property to programmatically access the client object rendered for the ASPxUploadControl control in client-side script.

Run Demo: Upload Control

Example

<script type="text/javascript">
     function onFileUploadComplete(s, e) {
          if(e.callbackData) {
               var fileData = e.callbackData.split('|');
               var fileName = fileData[0],
               fileUrl = fileData[1],
               fileSize = fileData[2];
               DXUploadedFilesContainer.AddFile(fileName, fileUrl, fileSize);
          }
     }
</script>

<dx:ASPxUploadControl ID="UploadControl" runat="server" ClientInstanceName="UploadControl" Width="100%"
     NullText="Select multiple files..." UploadMode="Advanced" ShowUploadButton="True" 
     ShowProgressPanel="True" OnFileUploadComplete="UploadControl_FileUploadComplete">
     <AdvancedModeSettings EnableMultiSelect="True" EnableFileList="True" EnableDragAndDrop="True" />
     <ValidationSettings MaxFileSize="4194304" AllowedFileExtensions=".jpg,.jpeg,.gif,.png" />
     <ClientSideEvents FilesUploadStart="function(s, e) { DXUploadedFilesContainer.Clear(); }"
                       FileUploadComplete="onFileUploadComplete" />
</dx:ASPxUploadControl>

<dx:UploadedFilesContainer ID="FileContainer" runat="server" Width="100%" Height="180"
     NameColumnWidth="240" SizeColumnWidth="70" HeaderText="Uploaded files" />

Inheritance

See Also