>When entering in a Web form, if I have defined the form so no control contains a TabIndex attribute, what would be the easiest way to detect the first control of the chain? I would like to adjust the framework DataEntry() class to be smart enough to assign that control as the default control so to get the focus on it, but only if no control contains a TabIndex attribute.
Presently, I have this approach. I have added a control cFocus on my DataEntry class of the framework. The DataEntry.DataEntry() method contains this code at the end:
If cFocus.Length > 0 Then
loControlTextbox = oProcess.oPage.FindControl(cFocus)
loControlTextbox.Focus()
End If
This works. But, it assumes it can only be used on a textbox control. But, this is not the main issue. The main issue is that I have to set the cFocus property on all my pages and I would like to avoid that. I would like the DataEntry() method to be smart enough to find the first control by itself.