title: How to add more than one hot spot to ImageMap control in code behind (programmatically)
body: <p>My simple application arranges weblinks on the image and depending on the type of image number of weblinks is different. I use ImageMap control and add in code behind hot spots. Coordinates and url are get from the data base. Below there is a code:</p>
  
  <pre><code>protected void ArrangeMapHotSpots(int voivodshipId)
  {
      PolygonHotSpot hotSpot = new PolygonHotSpot();
      DataTable ImageMapDT = EzdrojeDB.ImageMapCoordinates(voivodshipId); // get data form DB   
      foreach (DataRow dr in ImageMapDT.Rows)
      {
  
          hotSpot.HotSpotMode = HotSpotMode.Navigate;
          hotSpot.AlternateText = "alt_text";
          hotSpot.Coordinates = dr["map_coord"].ToString();
          hotSpot.NavigateUrl = "~/resort.aspx?id=" + dr["id"].ToString();
          ImageMap1.HotSpots.Add(hotSpot);
      }
  }
  </code></pre>
  
  <p>The problem is when I run the app and I have only one link active  (but there are 11 rows (links) in this particular DataTable object).</p>
  
  <p>Below html code:</p>
  
  <pre><code>&lt;img id="ContentPlaceHolder1_ImageMap1" src="Images/VoivodMaps/dolnoslaskie.png" usemap="#ImageMapContentPlaceHolder1_ImageMap1" /&gt;
  
  &lt;map name="ImageMapContentPlaceHolder1_ImageMap1" id="ImageMapContentPlaceHolder1_ImageMap1"/&gt;
  area shape="poly" coords="303,427,444,447" href="resort.aspx?id=11" title="alt_text" alt="alt_text" /&gt;
  area shape="poly" coords="303,427,444,447" href="resort.aspx?id=11" title="alt_text" alt="alt_text" /&gt;
  area shape="poly" coords="303,427,444,447" href="resort.aspx?id=11" title="alt_text" alt="alt_text" /&gt;
  area shape="poly" coords="303,427,444,447" href="resort.aspx?id=11" title="alt_text" alt="alt_text" /&gt;
  area shape="poly" coords="303,427,444,447" href="resort.aspx?id=11" title="alt_text" alt="alt_text" /&gt;
  area shape="poly" coords="303,427,444,447" href="resort.aspx?id=11" title="alt_text" alt="alt_text" /&gt;
  area shape="poly" coords="303,427,444,447" href="resort.aspx?id=11" title="alt_text" alt="alt_text" /&gt;
  area shape="poly" coords="303,427,444,447" href="resort.aspx?id=11" title="alt_text" alt="alt_text" /&gt;
  area shape="poly" coords="303,427,444,447" href="resort.aspx?id=11" title="alt_text" alt="alt_text" /&gt;
  area shape="poly" coords="303,427,444,447" href="resort.aspx?id=11" title="alt_text" alt="alt_text" /&gt;
  area shape="poly" coords="303,427,444,447" href="resort.aspx?id=11" title="alt_text" alt="alt_text" /&gt;
  &lt;/map&gt;
  </code></pre>
  
  <p>There have been 11 hot spots added but each of them has the same coordinates and id in url string. 
  Can anyone explain me what has happend and how to add more than one hot spot to ImageMap programmatically.</p>