Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: Binding Data within a Public Class


Message #1 by "Jon Hilton" <jmh@s...> on Thu, 10 Jan 2002 16:24:10
I am trying to create a Public Class which takes a folder address and 

displays a list of files/folders within that folder.



I am struggling with a Sub which I'm calling List which I intend to use to 

retrieve a list of the files in a given address and bind the results of 

that (the list of files) to a DataList.



The code for the Sub is as follows:



.....

Public Sub List()



Dim dirInfo As New DirectoryInfo(_address)

Dim aFiles as FileInfo() = dirInfo.GetFiles ("*.*")

dlDataList.DataSource = aFiles

dlDataList.DataBind()



End Sub

......



However, this throws up an error message as follows:



......

BC30469: This reference to a non-shared member requires an object 

reference, and none is supplied.

......



I'm new to ASP.NET and am just trying to get my head around the way it 

works so any help with this would be much appreciated!



Regards

Jon Hilton




  Return to Index