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

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top