>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement