Common MapTips
Common_MapTips_VBNet\CustomFormat_Client.aspx.vb
' Copyright 2011 ESRI
' 
' All rights reserved under the copyright laws of the United States
' and applicable international laws, treaties, and conventions.
' 
' You may freely redistribute and use this sample code, with or
' without modification, provided you include the original copyright
' notice and use restrictions.
' 
' See the use restrictions.
' 

Imports Microsoft.VisualBasic
Imports System
Partial Public Class CustomFormat_Client
  Inherits System.Web.UI.Page
  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
    ' JavaScript added to the page on application startup to call the client-side MapTips
    ' format initialization method and pass it the MapTips GraphicsLayers' client ID.  We
    ' place the call in a timeout to ensure that the script containing the function has
    ' been loaded prior to the call.
    Dim setMapTipsWidthJavaScript As String = "" & ControlChars.CrLf & "            // Declare a function to call the initialization method." & ControlChars.CrLf & "            function initializeMapTipsFormat() {{" & ControlChars.CrLf & "                window.setTimeout(""applyCustomMapTipsFormat('{0}');"", 0);" & ControlChars.CrLf & "            }}            " & ControlChars.CrLf & ControlChars.CrLf & "            // Wire the function to fire during the AJAX client-side load event" & ControlChars.CrLf & "            Sys.Application.add_load(initializeMapTipsFormat);"

    ' Replace "{0}" with the MapTips GraphicsLayer's client-side ID.
    setMapTipsWidthJavaScript = String.Format(setMapTipsWidthJavaScript, MapTips1.GraphicsLayerClientID)

    ' Register the code as a startup script
    Page.ClientScript.RegisterStartupScript(Me.GetType(), "initMapTipsFormat", setMapTipsWidthJavaScript, True)
  End Sub
End Class