Dim arrTempList As New ArrayList()
oThis.myArrayList = arrTempList
You seem to be initializing an ArrayList somewhere in the code of your
Control. When you initialize it, it is empty. You then assing it to a public
property "myArrayList" (not sure where the "o" came from, but if the code
compiles, I'm assuming it's not in your actual code). The public property
exposes a private ("arrChartList") ArrayList. Kludgy, but it will work. So
far.
Now, what you have told me is that when you "try to use the arraylist" in
your "webpage" it is empty. Why that is, I can't tell from what you've
posted, as nothing you've posted indicates how it is supposed to be
populated, at what point in the execution cycle it is populated, if and how
it is persisted across PostBacks, etc.
At this point, all I can give you is a pointer or 2 on your initialization
of the ArrayList:
Dim arrTempList As New ArrayList()
oThis.myArrayList = arrTempList
This is all completely unnecessary. Consider the following:
Protected arrChartList As New Arraylist()
Public Property myArrayList As ArrayList
Get
Return arrChartList
End Get
Set
arrChartList = value
End Set
End Property
or, if you want to be even more simple, since you declared the
"arrChartList" as Public:
Public arrChartList As New Arraylist()
Why? Well, first, a field and a variable are the same thing in different
scopes. When you say:
Dim arrTempList As New ArrayList()
at class scope, you are saying the same thing as:
Private arrTempList As New ArrayList()
So, in essence, you've declared 2 fields ("arrTempList" and "arrChartList"),
and simply assigned the value of one to the other. Now you have 2 fields
that point to the same ArrayList.
Second, when you assign it to the Public Property:
This.myArrayList = arrTempList
You are invoking the Setter of the Property to assign the value of the field
"arrChartList". In other words, you are using indirection, and calling a
method to assign a value which could be assigned less expensively by simple
assignment. But again, it is not necessary to declare 2 fields.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.