Tuesday, May 15, 2007

OnSelectedIndex event does not fire

Today I had a weird problem after modifying the html portion an aspx file, problem was drop down control was not firing the SelectedIndexChanged event. I checked the initialization event from the hidden fields it was quite evident that postback was triggered from drop down box, but in load event drop down selected item was set to -1 !!!! after cracking head for two hours, I moved the form tag into the inner table which had the drop down control, page started to work fine!!!.

Looks like if the table structure is not properly nested then drop down box's SelectedIndexChanged event will not work.