J
Justin Bartels
Hi,
I have been struggling with an unusual problem with a
dropdownlist web control for quite some time now.
Cutting straight to the problem, I am setting the
selected item in the dropdownlist using the IndexOf
method of the list's items collection (in my debugging
case this successfully sets the selectedindex to 15).
After postback, the selecteditem is always the first item
in the list, losing the selection I set previously (And
yes, enableviewstate is turned OFF for the control, and
the whole page as well). I set a breakpoint in the
page.unload event to check once more what the
selectedindex of the dropdown was, just to make sure I
was not accidentally resetting it elsewhere in code, but
the selecteditem was still set correctly (to 15) at this
point. Frustrated, I set a breakpoint in global.asax's
Global_PostRequestHandlerExecute, where the selectedindex
had mysteriously reset to 0. My question is: What could
possibly happen after page.unload and before
Global_PostRequestHandlerExecute to change the
selectedindex of this list? I have seen viewstate do
similar things but i have made certain that it is not on.
Thanks,
Justin Bartels
I have been struggling with an unusual problem with a
dropdownlist web control for quite some time now.
Cutting straight to the problem, I am setting the
selected item in the dropdownlist using the IndexOf
method of the list's items collection (in my debugging
case this successfully sets the selectedindex to 15).
After postback, the selecteditem is always the first item
in the list, losing the selection I set previously (And
yes, enableviewstate is turned OFF for the control, and
the whole page as well). I set a breakpoint in the
page.unload event to check once more what the
selectedindex of the dropdown was, just to make sure I
was not accidentally resetting it elsewhere in code, but
the selecteditem was still set correctly (to 15) at this
point. Frustrated, I set a breakpoint in global.asax's
Global_PostRequestHandlerExecute, where the selectedindex
had mysteriously reset to 0. My question is: What could
possibly happen after page.unload and before
Global_PostRequestHandlerExecute to change the
selectedindex of this list? I have seen viewstate do
similar things but i have made certain that it is not on.
Thanks,
Justin Bartels