Thanks for your reply. But my validation logic is on the server side. How can client side get to know the result of validation. Basically, I need to validate the uploaded file which is an excel file before allowing file to be uploaded to the server.
I think what I can do is to use the custom asyncUploadHandler and call validation class in the handler. then if validation failed, not continue on process the file and hope I can stop the file upload that way.
IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration,
CustomAsyncUploadResult result = CreateDefaultUploadResult<CustomAsyncUploadResult>(file);
bAuditSuccess = auditClass.Audit();
.Process(file, context, configuration, tempFileName);
result = CreateDefaultUploadResult<CustomAsyncUploadResult>(file);
I hope this works.