Assuming you are using the tabindex property, you can loop through the controls
on the form using server-side code to pick out the control's tabindex and set
other values.
Here's a little demo:
Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Dim cntrl As Control
Dim txtcntrl As TextBox
For Each cntrl In Page.Controls(1).Controls
If TypeOf cntrl Is System.Web.UI.WebControls.TextBox Then
txtcntrl = cntrl
If txtcntrl.TabIndex = 1 Then
Button1.Text = "The Textbox is tabindex " & _
txtcntrl.TabIndex.ToString
End If
End If
Next
End Sub
<form id="Form1" method="post" runat="server">
<p>
<asp:button id="Button1" tabindex="5" runat="server"
text="Button"></asp:button></p>
<p>
<asp:checkbox id="CheckBox1" tabindex="2"
runat="server"></asp:checkbox></p>
<p>
<asp:textbox id="TextBox1" tabindex="1"
runat="server"></asp:textbox></p>
<p>
<asp:imagebutton id="ImageButton1" tabindex="9" runat="server"
imageurl="
http://www.gc.ca/images/rollingflag.jpg"></asp:imagebutton></p>
</form>
Does this help?
Ken
MVP [ASP.NET]
Hello Friends, I need to look for a control can be Web
Form or Html Form, by means of the TabIndex property, how
I can do it?