Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting focus to the control on the page (AJAX site)
Message
De
22/02/2008 10:41:22
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
ASP.NET
OS:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01294462
Message ID:
01295386
Vues:
24
>>Setting DefaultFocus in the markup works for me. Also
 Page.Form.DefaultFocus = "textbox";
>>// or safer:
>>Page.Form.DefaultFocus = textbox.ClientId;
in the Page load has the same effect. In either case the following javascript is generated in the form tag of the HTML:
<script type="text/javascript">
>>//<![CDATA[
>>WebForm_AutoFocus('textbox');//]]>
>></script>
>
>Hi Viv,
>
>Does it matter that my textbox is not directly on the form but inside the LoginView control? I'll try your suggestion on Monday.

Wouldn't you have to make the loginView control to have focus and then inside your loginView control, make whatever control you want to have focus there?
Tim
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform