ASP Net Controls ASP.Net Tutorial

<%@ Page Language="VB"%>

   Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        If FileUpload1.HasFile Then
            Try
                FileUpload1.SaveAs("C:\Uploads\" & _
                   FileUpload1.FileName)
                Label1.Text = "File name: " & _
                   FileUpload1.PostedFile.FileName & "
" & _
                   "File Size: " & _
                   FileUpload1.PostedFile.ContentLength & " kb
" & _
                   "Content type: " & _
                   FileUpload1.PostedFile.ContentType
            Catch ex As Exception
                Label1.Text = "ERROR: " & ex.Message.ToString()
            End Try
        Else
            Label1.Text = "You have not specified a file."
        End If
   End Sub



    FileUpload Server Control


    
        
        
                 OnClick="Button1_Click" />