The RegisterStartupScript method emits the script just before the closing tag of the Page object’s <form runat= server> element.
VB.NET
RegisterStartupScript('Sample', '<SCRIPT Language=’javascript’>alert(’Hello World’);</SCRIPT>')
C#
RegisterStartupScript('Sample', '<SCRIPT Language=’javascript’>alert(’Hello World’);</SCRIPT>');
Alternatively, use the RegisterClientScriptBlock method which emits the client-side script just after the opening tag of the Page object’s <form runat= server> element.
Share with