Hi there, I've just started developing web applications for the first time. Im developing an ASP.Net Website. Ive started transferring code over from my windows application and found a few errors. In my windows application I had a search function in a form where on click the text in a text box would search the first list box and print any matches in the second list box. Here is the code:
In my website an error pops up highlighting the line "words = lstSearch1.Items.Item(a)" and says that the value of the list item cannot be converted to string. How do I go about fixing this or is there a different way of implementing a search function in an Asp.Net website?Code:lstSearch2.Items.Clear() Dim count As Integer = (lstSearch1.Items.Count - 1) Dim words As String For a = 0 To count words = lstSearch1.Items.Item(a) If InStr(words.ToLower, txtSearch.Text.ToLower) Then lstSearch2.Items.Add(words) End If Next




Reply With Quote