ValidateFileEventArgsSkipInternalValidation Property |
Gets or sets whether the internal validation should continue validating the file
specified by the
UploadedFile property.
Namespace: Kettic.AspNet.Controls.UploadAssembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntaxpublic bool SkipInternalValidation { get; set; }
Public Property SkipInternalValidation As Boolean
Get
Set
public:
property bool SkipInternalValidation {
bool get ();
void set (bool value);
}
member SkipInternalValidation : bool with get, set
Property Value
Type:
Booleanfalse to indicate that the internal validation should validate
the file specified by the
UploadedFile property; otherwise,
true
Remarks
Once your validation routine finishes, use the
SkipInternalValidation
property to skip the internal validation provided by the
KaxUpload
control.
Examples
This example demostrates how to implement custom validation for specific file type.
private void KaxUpload1_ValidatingFile(object sender, ValidateFileEventArgs e)
{
if (e.UploadedFile.GetExtension().ToLower() == ".zip")
{
int maxZipFileSize = 10000000;
if (e.UploadedFile.ContentLength > maxZipFileSize)
{
e.IsValid = false;
}
e.SkipInternalValidation = true;
}
}
Private Sub KaxUpload1_ValidatingFile(ByVal sender As Object, ByVal e As WebControls.ValidateFileEventArgs) Handles KaxUpload1.ValidatingFile
If e.UploadedFile.GetExtension.ToLower = ".zip" Then
Dim maxZipFileSize As Integer = 10000000
If e.UploadedFile.ContentLength > maxZipFileSize Then
e.IsValid = False
End If
e.SkipInternalValidation = True
End If
End Sub
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also