Skip to main content
A newer version of this page is available. .

ASPxClientUploadControlFileUploadCompleteEventArgs.isValid Property

Gets or sets a value indicating whether the uploaded file passes validation.

Declaration

isValid: boolean

Property Value

Type Description
boolean

true if the file is valid; otherwise, false.

Remarks

Use the isValid property to determine whether the uploaded file meets your validation criteria. You can define the required validation criteria by using the ASPxUploadControl.ValidationSettings property or by implementing custom validation logic within the ASPxUploadControl.FileUploadComplete event’s handler. In the latter case, you need to set the FileUploadCompleteEventArgs.IsValid property manually while handling the event.

Example

The following part of the ASPxUploadControl Multi-File Upload online demo illustrates the ASPxUploadControl’s capability to upload more than one file at a time.

var fieldSeparator = "|";
function FileUploadStart() {
    document.getElementById("uploadedListFiles").innerHTML = "";
}
function FileUploaded(s, e) {
    if(e.isValid) {
        var linkFile = document.createElement("a");
        var indexSeparator = e.callbackData.indexOf(fieldSeparator);
        var fileName = e.callbackData.substring(0, indexSeparator);
        var pictureUrl = e.callbackData.substring(indexSeparator + fieldSeparator.length);
        var date = new Date();
        var imgSrc = "UploadImages/" + pictureUrl + "?dx=" + date.getTime();
        linkFile.innerHTML = fileName;
        linkFile.setAttribute("href", imgSrc);
        linkFile.setAttribute("target", "_blank");
        var container = document.getElementById("uploadedListFiles");
        container.appendChild(linkFile);
        container.appendChild(document.createElement("br"));
    }
}
See Also