Hi!
The ASPxUploadControl uses the standard input element with the type="file" to upload files.
The input element always uploads a selected file when form submitting is performed.
When submitting a form, all form data is sent to the server, and file uploading is performed.
It's impossible to cancel file uploading only. It's possible to cancel form submitting only.
Here is the code, implementing this behavior:
<script type="text/javascript">
function IsUploadAllow() {
var cancelUpload = true;
// some conditions
return !cancelUpload;
}
</script>
<form id="form1" runat="server" onsubmit="return IsUploadAllow();">
<input id="Submit1" type="submit" value="submit" />
</form>
The client-side ASPxClientUploadControl.Cancel method allows you to cancel file uploading via callback only.
You can learn more about this method from the following help topic:
http://www.devexpress.com/Help/?document=ASPxperience/DevExpressWebASPxUploadControlScriptsASPxClientUploadControl_Canceltopic.htm