Skip to main content

ASPxClientUploadControl.FileUploadStart Event

Obsolete. Occurs on the client side before upload of the specified files starts.

Declaration

FileUploadStart: ASPxClientEvent<ASPxClientUploadControlFilesUploadStartEventHandler<ASPxClientUploadControl>>

Event Data

The FileUploadStart event's data class is ASPxClientUploadControlFilesUploadStartEventArgs. The following properties provide information specific to this event:

Property Description
cancel Gets or sets a value indicating whether the action which raised the event should be canceled.

Remarks

Handle the FileUploadStart event to perform specific client actions before upload of the specified file (or files) starts. Note, when uploading multiple files, the event fires only once before the upload starts. After the files have been uploaded, the ASPxClientUploadControl.FilesUploadComplete event fires.

Example

<script type="text/javascript">
     function onFileUploadStart(s, e) {
          DXUploadedFilesContainer.Clear();
     }
     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">
     </ValidationSettings>
     <ClientSideEvents FilesUploadStart="onFileUploadStart" FileUploadComplete="onFileUploadComplete" />
</dx:ASPxUploadControl>

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