|
<EditForm Model="@employee" OnValidSubmit="@HandleValidSubmit">
<SfUploader @ref="@UploadObj" ID="UploadFiles" AutoUpload="false">
<UploaderEvents ValueChange="OnChange"></UploaderEvents>
</SfUploader>
<button type="submit" class="btn btn-primary">Submit</button>
</EditForm>
@code { SfUploader UploadObj;
public Employee employee = new Employee();
public async Task HandleValidSubmit()
{
await this.UploadObj.Upload(); // Upload the selected file manually
}
}
<style> // To hide upload and clear buttons
.e-upload-actions {
display: none;
}
</style>
|
|
|
Hi Dont,
Greetings from Syncfusion support.
We have checked your requirement. We would like to know you that if AutoUpload property is set to false, Upload and Clear buttons will be rendered below the selected file list to upload the files manually. However, you can hide those buttons by overriding the style and manually upload the file in the form submit. Please refer to the code snippet and sample below.
Sample Link : https://www.syncfusion.com/downloads/support/forum/157428/ze/Uploader-1076017426
Hi Dont,
We would like to inform you that await will not wait for the corresponding method call to complete. Please refer to the below answer provided in the Stackoverflow community for further reference.
Stackoverflow Link : https://stackoverflow.com/a/15151444/9133493
Regards,Jeyanth.
await does is to return the result of the operation immediately and synchronously if the operation has already completed or, if it hasn't, to schedule a continuation to execute the remainder of the async method and then to return control to the caller.