Common MapTips
Common_MapTips_CSharp\CustomFormat_Server.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 CustomFormat_Server : System.Web.UI.Page 
{
    protected void Page_Load(object sender, System.EventArgs e)
    {
        // We set the appearance of the MapTips title using the Title property of the MapTips' LayerFormat.
        // The appearance can be specified using HTML and CSS.  Field names surrounded with curly braces
        // are substituted at run-time with the corresponding field value of the feature on which a
        // MapTip is currently shown.  In this example, the AREANAME field is shown.
        MapTips1.LayerFormat.Title = 
            "<font style='font-family:verdana; color:green; font-size:14pt;'>{AREANAME}</font>";

        // The appearance of MapTips content can be altered via the Contents property of the MapTips'
        // LayerFormat.
        MapTips1.LayerFormat.Contents = "<table cellpadding='3px'><tr>" +
            "<td style='border-bottom:1px solid gray; border-right:1px solid gray; font-weight:bold; font-family:arial;'>" + 
            "Population</td>" +
            "<td style='border-bottom:1px solid gray; border-right:1px solid gray; font-style:italic; font-family:arial; " +
            "color:red;'>{POP2000}</td></tr>" +
            "<tr><td style='border-bottom:1px solid gray; border-right:1px solid gray; font-weight:bold; " +
            "font-family:arial;'>State</td>" +
            "<td style='border-bottom:1px solid gray; border-right:1px solid gray; font-style:italic; font-family:arial; " +
            "color:red;'>{ST}</td></tr></table>";
    }
}