Hi, I click on items in my listbox and then hit a submit button, but when istep through my button_clicked code it doesn't detect any selectedindex. All controls are in the same form and there are no panels. Why can't I detect what items were clicked on in the listbox? Thanks!
+2
A:
What about your page load? Maybe you load your listbox in page load and so every time you click the button it loads items again.
NetSide
2010-04-16 13:29:52
Doh!..that was it. I wrapped in a "If me.IsPostBack = False then" and now it works great. Thanks!
William
2010-04-16 13:37:21
cool, no worries :)
NetSide
2010-04-30 09:00:38
A:
Probably you aren't checking if it is a postback. Only load the listbox if it isn't postback.
Onload(EventArgs e)
{
If(!IsPostBack)
{
//Your code here...
Pedro MM
2010-04-16 13:36:19