UploadedFiles.Item(0) to C#

Thread is closed for posting
1 posts, 0 answers
  1. Moon
    Moon avatar
    250 posts
    Member since:
    Apr 2008

    Posted 01 Feb 2009 Link to this post

    In my VB code I have:


            Public Function GetExtension(ByVal radFileUpload As RadUpload) As String 
                Dim fileExtension As String = String.Empty  
                If radFileUpload.UploadedFiles.Count > 0 Then 
                    Dim validFile As UploadedFile = radFileUpload.UploadedFiles.Item(0)  
                    fileExtension = validFile.GetExtension  
                End If 
                Return fileExtension  
            End Function 

    But when i convert this to C#, I get an error on the Item(0):

     UploadedFile validFile = radFileUpload.UploadedFiles.Item[0];

    It says Telerik doesn't contain a definition for Item.

    How do I write this in C#?


    I have:
    using Telerik.Web.UI;


Back to Top