aspnet-devexpress-dot-web-dot-uploadcontrolvalidationsettings-5f5defda.md
Gets or sets the error text indicating that the uploaded file’s size exceeds the maximum allowed value.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
[DefaultValue("File size exceeds the maximum allowed size, which is {0} bytes")]
public string MaxFileSizeErrorText { get; set; }
<DefaultValue("File size exceeds the maximum allowed size, which is {0} bytes")>
Public Property MaxFileSizeErrorText As String
| Type | Default | Description |
|---|---|---|
| String | "File size exceeds the maximum allowed size, which is {0} bytes" |
A String value that specifies the error text.
|
You can access this nested property as listed below:
| Library | Object Type | Path to MaxFileSizeErrorText |
|---|---|---|
| ASP.NET MVC Extensions | UploadControlBinderSettings |
.ValidationSettings .MaxFileSizeErrorText
| | UploadControlSettings |
.ValidationSettings .MaxFileSizeErrorText
| | ASP.NET Web Forms Controls | ASPxUploadControl |
.ValidationSettings .MaxFileSizeErrorText
|
The error text is displayed within the ASPxUploadControl ‘s specific error frame, if the uploaded file’s size exceeds the value defined by the UploadControlValidationSettings.MaxFileSize property.
<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));
}
}
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