Error: Object reference not set to an instance of an object
I am trying to set the datasource of a listbox on a form to the arraylist generated from a custom control.
My code looks like this:
Protected withevents listbox1 as System.Web.UI.WebControls.ListBox
Public Sub ListLoad (ByVal CntArray as arraylist)
Dim CntArray As ArrayList = New ArrayList()
CntArray.Add("Sam"
CntArray.Add("Joe"
CntArray.Add("Mike"
Listbox1.DataSource = CntArray
Listbox1.DataBind()
End Sub
I am trying to set the datasource of a listbox on a form to the arraylist generated from a custom control.
My code looks like this:
Protected withevents listbox1 as System.Web.UI.WebControls.ListBox
Public Sub ListLoad (ByVal CntArray as arraylist)
Dim CntArray As ArrayList = New ArrayList()
CntArray.Add("Sam"
CntArray.Add("Joe"
CntArray.Add("Mike"
Listbox1.DataSource = CntArray
Listbox1.DataBind()
End Sub