Posted on: 10/24/2014 5:53:07 PM | Views : 449

Long time winform programmer venturing into new territory.
I have a listbox with a label and a pushbutton. The pushbutton tells you what item was selected. It's pretty simple but somehow it's not selecting the item on the list box.
SelectedIndex always says -1. When hardcoded to 3, it shows correct. What am I missing?
<html xmlns="http://www.w3.org/1999/xhtml"> <head > <title></title> <script runat="server"> void SubmitBtn_Click(Object sender, EventArgs e) { // if (ListBox1.SelectedIndex > -1) ListBox1.SelectedIndex = 3; Label1.Text = "The first ietm you chose:" + ListBox1.SelectedItem.Text; } </script> </head> <body style="height: 488px"> <form id="form1" runat="server"> <div> </div> < ...

Go to the complete details ...