I was wondering if anyone could help me with this. I used this class called MyList that I got from this page on a VB.NET project I just finished. It is located at this address http://vbcity.com/forums/faq.asp?fid=15&cat=ListBox%2FComboBox#TID47804. I am now developing an identical page, but in ASP.NET and the methods I am trying to use in Code Behind are no longer functioning correctly. Example:
The entire .Items.Add() line is underlined blue as well as this one...
Any Ideas on how to get this to work in ASP.NET using code behind? Any help is greatly appreciated. Thanks in advance
VB.NET:
[size=2][color=#0000ff]
Dim[/color][/size][size=2] i [/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#0000ff]Integer
[/color][/size][size=2][color=#0000ff]For[/color][/size][size=2] i = 0 [/size][size=2][color=#0000ff]To[/color][/size][size=2] SQLDSET.Tables(0).Rows.Count() - 1
[/size][size=2][color=#0000ff] With[/color][/size][size=2] lsttests
.Items.Add([/size][size=2][color=#0000ff]New[/color][/size][size=2] Mylist(SQLDSET.Tables(0).Rows(i).ItemArray(0),SQLDSET.Tables(0).Rows(i).ItemArray(1)))
[/size][size=2][color=#0000ff] End[/color][/size][size=2][color=#0000ff]With
[/color][/size][size=2][color=#0000ff]Next
[/color][/size]
VB.NET:
[size=2][color=#008000]
' Gets the currently selected item's hidden id number in the ListBox.
[/color][/size][size=2][color=#0000ff]Dim[/color][/size][size=2] curItem [/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#0000ff]String[/color][/size][size=2] = lsttests.Items(lsttests.SelectedIndex).ItemData()
[/size]
Any Ideas on how to get this to work in ASP.NET using code behind? Any help is greatly appreciated. Thanks in advance