Skip to main content
Tab

UploadControlValidationSettings.ErrorStyle Property

Gets the style settings for rendering the error message that is displayed if the uploaded file does not pass validation.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

public AppearanceStyleBase ErrorStyle { get; }

Property Value

Type Description
AppearanceStyleBase

A AppearanceStyleBase object that contains style settings for the error message.

Property Paths

You can access this nested property as listed below:

Library Object Type Path to ErrorStyle
ASP.NET Web Forms Controls ASPxUploadControl
.ValidationSettings .ErrorStyle
ASP.NET MVC Extensions UploadControlBinderSettings
.ValidationSettings .ErrorStyle
UploadControlSettings
.ValidationSettings .ErrorStyle

Example

<dx:ASPxUploadControl ID="ASPxUploadControl1" runat="server" OnFileUploadComplete="uc_FileUploadComplete">
    <ValidationSettings AllowedFileExtensions=".txt,.jpg,.jpe,.jpeg,.doc" MaxFileSize="1000000" 
        FileDoesNotExistErrorText="A file cannot be found." 
        GeneralErrorText="File uploading fails due to an external error that doesn't relate to the ASPxUploadControl's functionality." 
        MaxFileSizeErrorText="Uploaded file size exceeds the maximum file size." 
        NotAllowedFileExtensionErrorText="The file extension is not allowed.">
        <ErrorStyle BackColor="Yellow" ForeColor="Black" />
    </ValidationSettings>
</dx:ASPxUploadControl>
protected void uc_FileUploadComplete(object sender, DevExpress.Web.FileUploadCompleteEventArgs e) {
    if (e.IsValid) {
        ASPxUploadControl1.SaveAs(MapPath("Images/" + ASPxUploadControl1.FileName));
    }
}
See Also