Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Completion of code in a Web form
Message
From
17/04/2006 09:32:38
Keith Payne
Technical Marketing Solutions
Florida, United States
 
 
To
17/04/2006 00:58:43
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01113996
Message ID:
01114044
Views:
19
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform