KaxUploadValidatingFile Event |
Occurs before the internal validation of every file in the
UploadedFiles collection.
Namespace: Kettic.AspNet.ControlsAssembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax public event ValidateFileEventHandler ValidatingFile
Public Event ValidatingFile As ValidateFileEventHandler
public:
event ValidateFileEventHandler^ ValidatingFile {
void add (ValidateFileEventHandler^ value);
void remove (ValidateFileEventHandler^ value);
}
member ValidatingFile : IEvent<ValidateFileEventHandler,
ValidateFileEventArgs>
Value
Type:
Kettic.AspNet.Controls.UploadValidateFileEventHandlerRemarks To skip the internal validation of the file, set e.SkipInternalValidation = true.
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