Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Logical way to detect the default field
Message
De
30/07/2007 12:55:52
 
 
À
29/07/2007 14:13:06
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires Web
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01244454
Message ID:
01244642
Vues:
12
>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 we have to set the focus on a control
            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.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform