Strange tab ordering when creating controls after postback

Posted by Crackerjack on Stack Overflow See other posts from Stack Overflow or by Crackerjack
Published on 2010-03-24T20:24:01Z Indexed on 2010/03/24 20:53 UTC
Read the original article Hit count: 280

Filed under:
|

I have a button that opens a panel in a popup window and then performs a postback to retrieve data from the server and render some controls. Some of the controls are textboxes and some are dropdown lists and can be in any order. Everything works fine when tabbing through the textbox controls. But when tabbing from the first dropdown contorl found, the tab order 'gets lost' and it starts tabbing from the first control again. When I tab to the same dropdown list the second time 'round, it correctly tabs to the next control. Does anyone know what might be going on?

Example:

TextBox1 (Tab -> focus set to 'TextBox2')
TextBox2 (Tab -> focus set to 'DropDown1')
DropDown1 (Tab -> focus goes back up to 'TextBox1' - wtf?)
TextBox3

Update: The TabIndex attribute is set on all controls.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about html