Using the RegisterClientScriptBlock method (VB) : RegisterClientScriptBlock « Page Lifecycle « ASP.NET Tutorial

<%@ Page Language="VB" %>

<script runat="server">
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
      Dim myScript As String = "function AlertHello() { alert('Hello ASP.NET'); }"
      Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "MyScript", _
         myScript, True)
    End Sub

<html xmlns="" >
<head id="Head1" runat="server">
    <title>Adding JavaScript</title>
    <form id="form1" runat="server">
        <asp:Button ID="Button1" Runat="server" Text="Button" 
         OnClientClick="AlertHello()" />

5.16.1.Using the RegisterClientScriptBlock method (C#)
5.16.2.Using the RegisterClientScriptBlock method (VB)