Back to Devexpress

UploadControlValidationSettings.GeneralErrorText Property

aspnet-devexpress-dot-web-dot-uploadcontrolvalidationsettings-600175f0.md

latest3.4 KB
Original Source

UploadControlValidationSettings.GeneralErrorText Property

Gets or sets the error text indicating that an external error occurs during the specified file’s uploading.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue("File upload failed due to an external error")]
public string GeneralErrorText { get; set; }
vb
<DefaultValue("File upload failed due to an external error")>
Public Property GeneralErrorText As String

Property Value

TypeDefaultDescription
String"File upload failed due to an external error"

A String value that specifies the error text.

|

Property Paths

You can access this nested property as listed below:

LibraryObject TypePath to GeneralErrorText
ASP.NET MVC ExtensionsUploadControlBinderSettings

.ValidationSettings .GeneralErrorText

| | UploadControlSettings |

.ValidationSettings .GeneralErrorText

| | ASP.NET Web Forms Controls | ASPxUploadControl |

.ValidationSettings .GeneralErrorText

|

Example

aspx
<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>
csharp
protected void uc_FileUploadComplete(object sender, DevExpress.Web.FileUploadCompleteEventArgs e) {
    if (e.IsValid) {
        ASPxUploadControl1.SaveAs(MapPath("Images/" + ASPxUploadControl1.FileName));
    }
}
vb
Protected Sub uc_FileUploadComplete(ByVal sender As Object, ByVal e As DevExpress.Web.FileUploadCompleteEventArgs)
    If e.IsValid Then
        ASPxUploadControl1.SaveAs(MapPath("Images/" & ASPxUploadControl1.FileName))
    End If
End Sub

See Also

UploadControlValidationSettings Class

UploadControlValidationSettings Members

DevExpress.Web Namespace