Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Seting Focus
Message
De
01/12/2004 10:20:16
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Versions des environnements
Environment:
ASP.NET
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
00965810
Message ID:
00966080
Vues:
11
Best solution I have found to this is a different mechanism to set the focus.

Instead of including a call to a "javascript:SetFocus();" function in the BODY onload directive and registering the "SetFocus()" function code using RegisterClientScriptBlock(), I now use the RegisterStartupScript() method to register a javascript statement setting the control focus.
<SCRIPT language="javascript">document.all.MyControl.focus();</SCRIPT>
The RegisterStartupScript() method registers the javascript code at the bottom of the page so all controls will be in place and available for referencing. This method requires no dependence on the onload directive.

Bill

>Is there a way to turn off that menu directive via property setting or code,
>and on the server side, to attach the script to body at server tag?
>
>Im not sure but I m thinking of changing the attribute onload in the last event render. So maybe you can overwrite the onload attribute during render event.
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform