I am trying to upload image files using html editor extender. Everything works fine so far and I am able to save the file on ImageUploadComplete
event. But I am not sure how to raise the error to UI and alert user if the image upload fails for some reason.
Your help would be very much appreciated. Thanks!
Update: We use MS enterprise library for exception handling. In normal postback errors, the exception gets logged first and would get redirected to the custom error page. The issues with using HTMLEditorExtender are:
- redirect on error is NOT working
fileupload control is showing wrong upload status - "Uploaded" even in case of failures.
Public Sub HTMLEditor_ImageUploadComplete(sender As Object, e As AjaxControlToolkit.AjaxFileUploadEventArgs) Handles HTMLEditor.ImageUploadComplete
HTMLEditor.AjaxFileUpload.SaveAs("D:\Uploads\" + Path.GetFileName(e.FileName))
End Sub