Common MapTips
Common_MapTips_VBNet\SetMapTipsWidth.aspx.vb
' Copyright 2010 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 SetMapTipsWidth
  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 make the MapTips GraphicsLayers'
    ' client-side ID available on the client.
    Dim setMapTipsWidthJavaScript As String = "" & ControlChars.CrLf & "            // Declare a function to set the variable storing the MapTips layer's client-side ID." & ControlChars.CrLf & "            function setMapTipsLayerID() {{" & ControlChars.CrLf & "                m_mapTipsLayerID = '{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(setMapTipsLayerID);"

    ' 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(), "initMapTipsLayerID", setMapTipsWidthJavaScript, True)
  End Sub
End Class