Hi,
For this, you can use the
ClientScriptManager
of the current page.
Here is an example:
ClientScript.RegisterStartupScript(typeof(_Default), "Message", "alert('Hello World');", true);
Explanation:
ClientScript.RegisterStartupScript(
<<a type to identify the script source>>,
<<a unique script identifier, used for not rendering the same script twice>>,
<<the js code to be pasted in the output rendering>>,
<<defines if a script tag should be written around your script>>);
Here the explanation from the MSDN:
http://msdn.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.registerstartupscript.aspx[
^]
Hope this helps.
Best regards and happy coding :)
Stops