Listing 4: A Common Pattern to Follow When Using the ClientScriptManager Object

<script runat="server">
  public void Page_Load(Object sender, EventArgs e)
    {
      // BEGIN COMMENT
      // Get a ClientScriptManager reference from the Page class.
      // END COMMENT
      ClientScriptManager scriptMgr = Page.ClientScript;
      // BEGIN COMMENT
      // Script keys provide the ClientScriptManager with information 
      // to identify the script in a page.
      // END COMMENT
      string key1 = "ScriptKey1";
      // BEGIN COMMENT
      // Get an instance of the Type object representing the current object type.
      // END COMMENT
      Type csType = this.GetType();
    }
</script>