Connecting Tech Pros Worldwide Forums | Help | Site Map

Unable to remove items from an asp.net listbox

Shawn K
Guest
 
Posts: n/a
#1: Jul 27 '05
I populate a listbox with the following code when my form loads:

lstBox.Items.Add("value");

Once the page loads, I give the user the ability to remove items from the
list box by selecting an item and executing the following code from a button
click event:

lstBoxs.Items.Remove(lstBox.SelectedItem);

This works as expected for items added to the box by the end user after the
page loads, but fails to work with items added when the page loads. Anyone
know what gives, or a workaround?



Closed Thread


Similar .NET Framework bytes