Hi Richard,
Thank you for contacting Syncfusion forums.
In the uploadbox control, we can use the success event to get the file name that is successfully uploaded and display it in the form. Similary you can use the error event to get the error message and the file name and display it in the form. Kindly refer to the following code:
|
<div class="posupload">
@Html.EJ().Uploadbox("UploadDefault").SaveUrl("SaveDefault").RemoveUrl("RemoveDefault").ClientSideEvents(e=>e.Success("onsuccess").Error("onerror"))
</div>
<br /><br />
<div id="msg"></div>
<script>
function onsuccess(args) {
$("#msg").html("");
var msg = "<span class='green'> <b style='color:green;'>Success - </b>" + args.files.name + "</span>"
$("#msg").append(msg);
}
function onerror(args) {
$("#msg").html("");
var msg = "<span class='red'> <b style='color:red;'>Failed - </b>" + args.error + " - " + args.files.name + " </span>";
$("#msg").append(msg);
}
</script> |
Regards,
Prince