I've got a listbox that's populated from a SQL datasource. The user can remove items from this list (and subsequently the database) by clicking on a button that runs a sub to delete the selected item in the list from the database.
The problem is that no matter what happens, when the delete sub fires on page post back, the listbox deletes the first item in the list (index 0) regardless of what was actually selected. I even disabled the delete to see what was happening and sure enough, the page stubbornly thinks that index 0 was selected on post back.
I've got no idea why this is happening since I've got virtually identical functions on other pages doing the same thing and they don't exhibit the problem. The listbox doesn't get repopulated on post back so that's not the problem.
Does anyone have any ideas why this might be happening?
The problem is that no matter what happens, when the delete sub fires on page post back, the listbox deletes the first item in the list (index 0) regardless of what was actually selected. I even disabled the delete to see what was happening and sure enough, the page stubbornly thinks that index 0 was selected on post back.
I've got no idea why this is happening since I've got virtually identical functions on other pages doing the same thing and they don't exhibit the problem. The listbox doesn't get repopulated on post back so that's not the problem.
Does anyone have any ideas why this might be happening?