ASP.Net - Call Method from markup that includes data-binding
<p>I have a user control in C# in ASP.NET. This user control has a method in the code-behind that is defined as follows:</p>

<pre><code>protected string GetGreeting(string name)
{
  if (String.IsNullOrEmpty(name))
  {
    return "Hello";
  }
  else
  {
    return "Hello " + name;
  }
}
</code></pre>

<p>My markup looks like the following:</p>

<pre><code>&lt;asp:Repeater ID="listRepeater" ClientIDMode="Static" runat="server" OnLoad="listRepeater_Load"&gt;
    &lt;HeaderTemplate&gt;
        &lt;table id="listTable" style="width:100%;"&gt;
            &lt;thead&gt;&lt;tr&gt;
                &lt;th&gt;Greeting&lt;/th&gt;
                &lt;th&gt;Actions&lt;/th&gt;
            &lt;/tr&gt;&lt;/thead&gt;
            &lt;tbody&gt;    
    &lt;/HeaderTemplate&gt;

    &lt;ItemTemplate&gt;
            &lt;tr&gt;
                &lt;td&gt;&lt;%# GetGreeting("FullName")%&gt;&lt;/td&gt;
                &lt;td&gt;&lt;a href='#'&gt;view info&lt;/a&gt;&lt;/td&gt;
            &lt;/tr&gt;
     &lt;/ItemTemplate&gt;

     &lt;FooterTemplate&gt;
            &lt;/tbody&gt;
        &lt;/table&gt;
    &lt;/FooterTemplate&gt;
&lt;/asp:Repeater&gt;
</code></pre>

<p>How do I bind the FullName property of the record in my data source? Right now, I keep seeing "Hello FullName". I want to see something like "Hello John Smith". What am I doing wrong?</p>

<p>Thank you!</p>
