I have a for loop in my code if you look at it above. I was just hoping that you might be able to shed some light on it. If I try to add the "LaunchDate" to the AutoCompleteExtender I get an error saying that it is not declared. I don't know how to take
the value from the for loop outside of it to use in the AutoCompleteExtender.
For Each dr As DataRow In myTable.Rows
Dim presenter As String = dr("Presenter").ToString
If presenter IsNot " " Or "NULL" Then
Dim launchdate As String = dr("LaunchDate").ToString
End If
Dim id As String = dr("ProductID").ToString()
Dim name As String = dr("ProductName").ToString()
Dim item As String =
AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(name, id, launchdate)
<---launchdate is underlined because it is not defined,
but it won't let me use FindControl here.--->
items.SetValue(item, i)
i += 1
Next
grinnellja
Participant
1221 Points
624 Posts
Re: AutoCompleteExtender to show an extra item based on if statement
Feb 28, 2012 03:54 PM|LINK
I have a for loop in my code if you look at it above. I was just hoping that you might be able to shed some light on it. If I try to add the "LaunchDate" to the AutoCompleteExtender I get an error saying that it is not declared. I don't know how to take the value from the for loop outside of it to use in the AutoCompleteExtender.
For Each dr As DataRow In myTable.Rows Dim presenter As String = dr("Presenter").ToString If presenter IsNot " " Or "NULL" Then Dim launchdate As String = dr("LaunchDate").ToString End If Dim id As String = dr("ProductID").ToString() Dim name As String = dr("ProductName").ToString() Dim item As String = AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(name, id, launchdate) <---launchdate is underlined because it is not defined, but it won't let me use FindControl here.---> items.SetValue(item, i) i += 1 Next