I have a asp.net page with a listbox, a textbox and a button. I simply populate the listbox on the page_load method with a couple of items. I then click an item however the textbox never gets populated. If i instead populate the textbox with the selectedindex of the listbox. In this case i always get -1 ie nothing selected.
in addition if i change the code behing the button to set the textbox go Listbox1.items.count it return 1 ie there is an item there!!!
why can i set another textbox to the correct number of items in the listbox but cannot reference the selected item directly?
in addition if i change the code behing the button to set the textbox go Listbox1.items.count it return 1 ie there is an item there!!!
why can i set another textbox to the correct number of items in the listbox but cannot reference the selected item directly?