ASPxClientUploadControl.UploadingProgressChanged Event
Occurs on the client side when the progress bar indicator position is changed.
#Declaration
UploadingProgressChanged: ASPxClientEvent<ASPxClientUploadControlUploadingProgressChangedEventHandler<ASPxClientUploadControl>>
#Event Data
The UploadingProgressChanged event's data class is ASPxClientUploadControlUploadingProgressChangedEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
current |
Gets the content length of the currently uploaded file. |
current |
Gets the name of the file being currently uploaded. |
current |
Gets the position of the current file upload progress. |
current |
Gets the content length of the current file already uploaded to the server. |
file |
Gets the number of the files selected for upload. |
progress | Gets the current position of total upload progress. |
total |
Gets the content length of the files selected for upload. |
uploaded |
Gets the content length of the files already uploaded to the server. |
#Remarks
The UploadingProgressChanged event is generated sequentially during a file upload (when a file piece of a specified size - UploadAdvancedModeSettings.PacketSize - is uploaded to a server) and is also invoked on a when the file upload is completed. This event can be used to implement a custom file upload visualization. The event’s argument exposes all the required information about the current state of the file upload.
Note
To function properly, the ASPx
Note
The Uploading
#Example
In this example, the ASPxProgressBar control is used to visualize the progress of a file upload initiated within the ASPxUploadControl. The ASPxClientUploadControl.UploadingProgressChanged
client event of the ASPxUploadControl is handled, to supply the ASPxProgressBar control with current progress information. Using the ASPxProgressBar as a separate control, allows placing it at any desired position within the page.
function OnBtnUploadClick(s, e){
if(uploadControl.GetText() != ""){
lblCompleteMessage.SetVisible(false);
pbUpload.SetPosition(0);
uploadControl.Upload();
btnUpload.SetEnabled(false);
pnlProgress.SetVisible(true);
}
}
function OnUploadProgressChanged(s, e){
pbUpload.SetPosition(e.progress);
}
function OnFileUploadComplete(s, e){
if(e.isValid){
btnCancel.SetVisible(false);
btnUpload.SetEnabled(true);
pbUpload.SetPosition(100);
lblCompleteMessage.SetVisible(true);
}
else{
btnUpload.SetEnabled(true);
pnlProgress.SetVisible(false);
}
}
function OnBtnCancelClick(s, e){
uploadControl.Cancel();
btnUpload.SetEnabled(true);
pnlProgress.SetVisible(false);
}
function OnUploadControlTextChanged(s, e){
btnUpload.SetEnabled(s.GetText() != "");
}