Back to Devexpress

DxUpload.FileUploadAborted Event

blazor-devexpress-dot-blazor-dot-dxupload-835131e1.md

latest1.8 KB
Original Source

DxUpload.FileUploadAborted Event

Fires when the file upload is aborted.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[Parameter]
public EventCallback<FileUploadEventArgs> FileUploadAborted { get; set; }

Event Data

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

PropertyDescription
FileInfoReturns information about a file.

Remarks

The FileUploadAborted event occurs when a user clicks the cancel button. This button is available if the AllowCancel property is set to true.

razor
<DxUpload Name="myFile" UploadUrl="https://localhost:10000/api/Upload/Upload/" 
          FileUploadAborted="@OnFileUploadAborted">
</DxUpload>
<div class="alert alert-info @(MessageVisible? " visible" : " invisible")">@MyMessage</div>

@code {
    bool MessageVisible { get; set; } = false;
    string MyMessage { get; set; } = "";

    void OnFileUploadAborted(FileUploadEventArgs e) {
        MyMessage = "Upload of the " + e.FileInfo.Name + " file was aborted.";
        MessageVisible = true;
        InvokeAsync(StateHasChanged);
    }
}

See Also

DxUpload Class

DxUpload Members

DevExpress.Blazor Namespace