RadUpload for ASP.NET

RadUpload Send comments on this topic.
IsValid Property
See Also  Example
Telerik.WebControls Namespace > ValidateFileEventArgs Class : IsValid Property


Gets or sets whether the value specified by UploadedFile property passed validation.   

 

Namespace: Telerik.WebControls
Assembly: RadUpload (in RadUpload.dll)

Syntax

Visual Basic (Declaration) 
Public Property IsValid As Boolean
Visual Basic (Usage)Copy Code
Dim instance As ValidateFileEventArgs
Dim value As Boolean
 
instance.IsValid = value
 
value = instance.IsValid
C# 
public bool IsValid {get; set;}

Return Value

true to indicate that the value specified by the UploadedFile property passed validation; otherwise, false

Example

This example demonstrates how to implement validation for filenames.
Visual BasicCopy Code
Private Sub RadUpload1_ValidatingFile(ByVal sender As Object, ByVal e As WebControls.ValidateFileEventArgs) Handles RadUpload1.ValidatingFile
    If e.UploadedFile.GetExtension.ToLower() = ".zip" Then
        'The zip files are not allowed for upload
        e.IsValid = False
    End If
End Sub
C#Copy Code
private void RadUpload1_ValidatingFile(object sender, ValidateFileEventArgs e)
{
   
if (e.UploadedFile.GetExtension().ToLower() == ".zip")
   {
       
//The zip files are not allowed for upload
       
e.IsValid = false;
   }
}
    

Remarks

Once your validation routine finishes, use the IsValid property to indicate whether the value specified by the UploadedFile property passed validation. This value determines whether the file from the RadUpload control passed validation.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also