title: Add image and dynamic text to a LinkButton
body: <p>I have a Horizontal DataList of several LinkButtons. 
   button represents a stage that can be whether "COMPLETED" (green image) or "NOT STARTED" (grey image).
  In addition, each such button must contain some text and it's stage number, for example: "STAGE 1", "STAGE 2" etc...</p>
  
  <p>I found several solutions but none of them answered both of my demands - the image and the text.</p>
  
  <p>Does anybody have a good and elegant solution on that matter?</p>
  
  <p>Here's the html code:</p>
  
  <pre><code>&lt;asp:DataList ID="dlStatuses" runat="server" RepeatDirection="Horizontal" 
          onitemdatabound="dlStatuses_ItemDataBound" 
          onitemcommand="dlStatuses_ItemCommand"&gt;
      &lt;HeaderTemplate&gt;
          &lt;table border="0" cellpadding="0" cellspacing="0"&gt;
      &lt;/HeaderTemplate&gt;
      &lt;ItemTemplate&gt;
          &lt;asp:LinkButton ID="linkBtnStatuses" runat="server"&gt;
              &lt;asp:Image ID="linkButtonImage" runat="server" ImageAlign="Middle" BorderStyle="None"/&gt;
          &lt;/asp:LinkButton&gt;
      &lt;/ItemTemplate&gt;
      &lt;/asp:DataList&gt;
  </code></pre>
  
  <p>and the code behind:</p>
  
  <pre><code>protected void dlStatuses_ItemDataBound(object sender, DataListItemEventArgs e)
  {
      if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
      {
          DataRow row = (e.Item.DataItem as DataRowView).Row;
  
          #region Place Icons
  
          int StatusLevel = int.Parse(row["LevelID"].ToString());
  
          LinkButton lnkButton = (e.Item.FindControl("linkBtnStatuses")) as LinkButton;
          Image img = (e.Item.FindControl("linkButtonImage")) as Image;
  
          //lnkButton.Text = " Stage No. " + StatusLevel.ToString(); 
  
          switch (StatusLevel)
          {
              case 1:
                  img.ImageUrl = "~/style/images/Green.png";
                  break;
              case 2:
                  img.ImageUrl = "~/style/images/Grey.png";
                  break;
      }
  }
  </code></pre>
  
  <p>Thanks in advance</p>