Error(ItemTypes As ArrayList) Name 'ItemTypes' is not declared

G

Guest

Hi Guys,
I have my .aspx below and i'm using SetIndex with selectedIndex with
DropDownList to retrieve Data from my database!!
My function of SetIndex is as follows:-
Function SetIndex(ByVal TheItem As String)

Dim ItemTypes As ArrayList
Dim i As Integer
For i = 0 To ItemTypes.Count - 1
If TheItem = ItemTypes(i) Then
Return i
End If
Next
End Function

When i compile it using VS.NET it comoiles but when i run it i get error
"Name 'ItemTypes' is not declared"
Do i have to still delcare ItemTypes some how..
Pls help!!

My Asp.Net
------------
<asp:TemplateColumn>
<HeaderTemplate>
Type<br>
<asp:DropDownList id="ItemType" runat="server"
DataSource='<%# ItemTypes %>'/>
</HeaderTemplate>
<ItemTemplate>
<asp:DropDownList id="Dropdownlist1" runat="server"
DataSource='<%# ItemTypes %>'
SelectedIndex='<%# SetIndex(Container.DataItem("ItemType")) %>'/>
</ItemTemplate>
</asp:TemplateColumn>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top