Common MapTips
Common_MapTips_CSharp\SetMapTipsWidth.aspx.cs
// 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.
// 

public partial class SetMapTipsWidth : System.Web.UI.Page 
{
    protected void Page_Load(object sender, System.EventArgs e)
    {
        // JavaScript added to the page on application startup to make the MapTips GraphicsLayers'
        // client-side ID available on the client.
        string setMapTipsWidthJavaScript = @"
            // Declare a function to set the variable storing the MapTips layer's client-side ID.
            function setMapTipsLayerID() {{
                m_mapTipsLayerID = '{0}';
            }}            

            // Wire the function to fire during the AJAX client-side load event
            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(this.GetType(), "initMapTipsLayerID",
            setMapTipsWidthJavaScript, true);
    }
}