Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Completion of code in a Web form
Message
De
17/04/2006 09:32:38
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
 
À
17/04/2006 00:58:43
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01113996
Message ID:
01114044
Vues:
18
>In a Web form, what is the event that will allow me to include some code in the page, by the use of Response.Write(), that I can use after all other processes have been completed on the page? Basically, I have some javascript messages, sometimes, that I need to show. But, this should only appear once all the rest has been sent. Otherwise, the message will appear but the page doesn't contain anything yet.

Page.RegisterClientScriptBlock will insert the referenced text/script after the HTML header - this is good for javascript function declarations.

Page.RegisterStartupSript will insert the script in the form's onLoad attribute (event) that fires after the form's closing tag is received.

Use these two together so that the bulk of the script is inside of a function and call the function with RegisterStartupScript.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform