Common Custom renderers
Common_CustomRenderers_CSharp\SimplePointRenderer.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 SimplePointRendererPage : System.Web.UI.Page 
{
  protected void Page_Load(object sender, System.EventArgs e)
  {
    if (!ScriptManager1.IsInAsyncPostBack)
    {
            // Potential inital load. Check if graphics resource has the graphics layer, and if not, create it
            ESRI.ArcGIS.ADF.Web.UI.WebControls.MapResourceItem mapResourceItem =
                MapResourceManager1.ResourceItems.Find("GraphicsDataSource");
            ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource graphicsMapResource =
                mapResourceItem.Resource as ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource;

            if (graphicsMapResource != null)
            {
                // Check whether the map extent is null, meaning the map has not yet been initialized
                if (Map1.Extent == null)
                {
                    // Forces earlier initialization of map and will set map extent
                    ESRI.ArcGIS.ADF.Web.DataSources.IMapResource primaryMapResource =
                        Map1.PrimaryMapResourceInstance;
                }

                // Call helper method in App_Code which generates a random graphics layer.  In real-world situations,
                // the random layer could be replaced with, for instance, the result of a query.  Once the layer is
                // created, apply the renderer and add the layer to the graphics resource.

                ESRI.ArcGIS.ADF.Web.Display.Graphics.FeatureGraphicsLayer featureGraphicsLayer =
                    ESRI.ADF.Samples.Renderers.GenerateGraphicsHelper.CreatePointFeatures("points", Map1.Extent, 50);

                if (featureGraphicsLayer != null)
                {
          ESRI.ADF.Samples.Renderers.SimplePointRenderer simplePointRenderer = 
                        new ESRI.ADF.Samples.Renderers.SimplePointRenderer();
                    // Name of column that contains the relative path to the image that will be used to 
                    // symbolize the feature
          simplePointRenderer.ImagePathColumn = "ImagePath"; 
                    featureGraphicsLayer.Renderer = simplePointRenderer; // Apply the renderer

                    // If a layer of the same name has already been added, remove it
                    if (graphicsMapResource.Graphics.Tables.Contains("points"))
                        graphicsMapResource.Graphics.Tables.Remove("points");

                    // Add the layer to the graphics resource
                    graphicsMapResource.Graphics.Tables.Add(featureGraphicsLayer);
                }
            }

            // Refresh the graphics resource so the newly added layer shows up
            Map1.RefreshResource("GraphicsDataSource");
        }
  }

}