Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setfocus to textbox control
Message
De
18/08/2003 21:45:58
Alvin Lourdes
Children and Youth Services Cluster
Toronto, Ontario, Canada
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Développement mobile
Titre:
Setfocus to textbox control
Divers
Thread ID:
00821258
Message ID:
00821258
Vues:
61
I would like a textbox to have focus at the start of the
application.

How would I code this? Im still trying to figure this one
out.

Im developing an asp.net mobile web application, c#
vs 2003.


The code below is what I have used. It does not seem to setfocus to the asp.net textbox.
I have also tried your code with c# language modifications. This also does not set focus to the textbox. Please let me know if I have a coding issue.
StringBuilder strBuilder = new StringBuilder(); 

strBuilder.Append("<script language = 'javascript'>"); 

strBuilder.Append("document.forms.MobileWebForm1.txtBarCodeReader.focus();"); 

strBuilder.Append("document.forms.MobileWebForm1.txtBarCodeReader.select();"); 



strBuilder.Append("</script>"); 

RegisterStartupScript("Focus",strBuilder.ToString()); 
Thanks
Alvin
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform