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>
<aspropDownList id="ItemType" runat="server"
DataSource='<%# ItemTypes %>'/>
</HeaderTemplate>
<ItemTemplate>
<aspropDownList id="Dropdownlist1" runat="server"
DataSource='<%# ItemTypes %>'
SelectedIndex='<%# SetIndex(Container.DataItem("ItemType")) %>'/>
</ItemTemplate>
</asp:TemplateColumn>
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>
<aspropDownList id="ItemType" runat="server"
DataSource='<%# ItemTypes %>'/>
</HeaderTemplate>
<ItemTemplate>
<aspropDownList id="Dropdownlist1" runat="server"
DataSource='<%# ItemTypes %>'
SelectedIndex='<%# SetIndex(Container.DataItem("ItemType")) %>'/>
</ItemTemplate>
</asp:TemplateColumn>