Gets or sets the tab index of the Web server control.
Assembly: System.Web (in System.Web.dll)
The specified tab index is not between -32768 and 32767.
Use theproperty to specify or determine the tab index of a Web server control on the Web Forms page. When you press the Tab key, the order in which the Web server controls receive focus is determined by the property of each control. When a page is initially loaded, the first item that receives focus when the Tab key is pressed is the address bar. Next, the controls on the Web Forms page are tabbed to in ascending order, based on the value of the property of each control, starting with the smallest positive, nonzero value. If multiple controls share the same tab index, the controls will receive focus in the order they are declared on the Web Forms page. Finally, controls that have a tab index of zero are tabbed to in the order they are declared.
Only controls with a nonzero tab index will render the tabindex attribute.
You can remove a Web Server control from the tab order by setting theproperty to a negative value.
This property is supported only in Internet Explorer 4 and later.
The following example illustrates how to use the WebControl to set the tab order of controls on the page.property of the
The following code sample uses the single-file code model and may not work correctly if copied directly into a code-behind file. This code sample must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see ASP.NET Web Forms Page Code Model.
This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview.
Available since 1.1