C
CCORDON
I have a problem with a listbox. I shows a number of records from a DB. ItemData = ProductId, ItemText = ProductName. It loads great. But when the user clicks on one of the items, this code:
Dim MyItem As New ListItem
MyItem = lstItems.SelectedItem
If Not (MyItem Is Nothing) Then
Dim MyProd As New Producto
Session("ResultMessage") = MyProd.Delete(lstItems.SelectedItem.Value)
Response.Redirect("Result.aspx?RedirectPage=Productos.aspx")
End If
Always returns the first item in the listbox.
Help Please.
Dim MyItem As New ListItem
MyItem = lstItems.SelectedItem
If Not (MyItem Is Nothing) Then
Dim MyProd As New Producto
Session("ResultMessage") = MyProd.Delete(lstItems.SelectedItem.Value)
Response.Redirect("Result.aspx?RedirectPage=Productos.aspx")
End If
Always returns the first item in the listbox.
Help Please.