asp.net + C# - Format data bound in a repeater
<p>I have an ASP.NET page that has a code-behind method that is defined as follows: </p>

<pre><code>public string GetStatusColor(int statusID)
{
  string color = "White";
  if (statusID == 3)
    color = "Red";
  else if (statusID == 2)
    color = "Blue";
  return color;
}
</code></pre>

<p>In my ASP.NET page, I have a Repeater that is defined as follows:</p>

<pre><code>&lt;asp:Repeater ID="ticketRepeater" runat="server" OnLoad="ticketRepeater_Load"&gt;
  &lt;HeaderTemplate&gt;
    &lt;table id="resultTable" cellpadding="0" cellspacing="0"&gt;    
      &lt;tr&gt;
        &lt;th&gt;Ticket #&lt;/th&gt;
        &lt;th&gt;Status&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/HeaderTemplate&gt;
  &lt;ItemTemplate&gt;
    &lt;tr&gt;
       &lt;td&gt;&lt;%# DataBinder.Eval(Container.DataItem, "TicketID") %&gt;&lt;/td&gt;
       &lt;td&gt;&lt;%# DataBinder.Eval(Container.DataItem, "TicketStatusID") %&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/ItemTemplate&gt;
  &lt;FooterTemplate&gt;
    &lt;/table&gt;
  &lt;/FooterTemplate&gt;
&lt;/asp:Repeater&gt;
</code></pre>

<p>Essentially, when the TicketStatusID is bound, I want to call back to GetStatusColor and display the result of the method instead of the actual ID. How do I do this in a Repeater? Thank you!</p>
