I need to know if there is a way in ASPX to auto select the first value in listbox,i've already tried to use
ListBox_servidores.SelectedIndex = 0;
ListBox_servidores.Items.Selected = true;
but its not working, the first code selects the first item in the listbox, but at the same time when i try to use the selected item in another piece of code it looks like it is not selected.
The second code just returns an error :
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
OP and Ed resolved the issue with comments!
Posting this to pop this one out of unanswered list.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)