Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting focus to first control on page
Message
De
04/03/2010 08:33:14
 
 
À
04/03/2010 08:02:28
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01452441
Message ID:
01452460
Vues:
37
>>Hi,
>>
>>I have tried this code as suggested in the dev guide to set focus to a text box in the page_load:
>>
>>
this.FocusedControl = this.txtUsername;
>>
>>but it doesn't work. I have found that this works though:
>>
>>
this.SetFocus(this.txtUsername);
>>
>>Is this the correct way to do this?
>
>There are a couple of ways to do this. You can call the Page.SetFocus() method passing in the control ID Or you can set the DefaultFoucs property of the form.
>
>For some reason lately I have had issues with: this.FocusedControl = this.txtMyTextBox
>It uses some javascript that continues to be an issue.
>Tim

hmm... I can't find a DefaultFocus property, can you tell me where that is, please? The help mentions this belongs to the form element, but I don't see a form on any of my pages. Is it called something else?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform