title: How to call extension methods using Eval in a databound control
body: <p>I have a simple extension method on the int type so I can do the following:</p>
  
  <pre><code>string timeLength = 61.ToTime() // timeLength will be "1:01"
  </code></pre>
  
  <p>This works great in code, but I want to use this extension method in a Repeater Template. When databinding I want to do the following:</p>
  
  <pre><code>&lt;%# Eval("LengthInSeconds").ToTime() %&gt;
  </code></pre>
  
  <p>That didn't work so I tried:</p>
  
  <pre><code>&lt;%# ((int) Eval("LengthInSeconds")).ToTime() %&gt;
  </code></pre>
  
  <p>and it still didn't work. The JIT compiler is not seeing my extension method and I do have the proper import statement in the page.</p>
  
  <p>My only idea for solving this is to replace the Eval with a Literal control and call the extension method in the code-behind, but either way, I would still like to know why this isn't working.</p>
  
  <p>Thanks</p>