Thursday, April 7, 2011

Having Trouble with TabIndex in ASP.NET?

I have had some trouble with my TabIndex on a couple of ASP.NET forms for a long while now. I just recently decided to investigate further on this annoying issue (really who has time for that stuff?!).

For the most part, this property does work correctly, however, inside of Wizard or ASP.NET pre-made controls (Login), it seems to not function as you would expect?

Let's start with the first check, make sure that you set the first TabIndex to 1 (TabIndex="1"). Supposedly browsers default the address bar to 0 so you are supposed to set yours to 1. If that does not fix your issue, continue.

If you are using a Wizard control or Login control, set the Wizard or Login control to TabIndex="1", then proceed to number the rest of your TextBoxes and stuff from there. That should fix it.

Amazingly, this solution was my own idea, I couldn't find anything on the 'net that covered this issue! So now I'm posting to help some poor busy programmer left to solve such an annoying problem.

Hope that helps someone.