Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It looks like you are missing the #</p> <pre><code>&lt;td&gt; &lt;%#(DateTime.Today.Subtract(DateTime.Parse(DataBinder.Eval(Container.DataItem, "BeneficiaryBirthday").ToString())).Days / 365).ToString()%&gt;&lt;/td&gt; </code></pre> <p>As an alternative though, consider creating a method to wrap your collection and using the foreach:</p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td class="labels displayInput_noWidth"&gt;Last Name&lt;/td&gt; &lt;td class="labels displayInput_noWidth"&gt;First Name&lt;/td&gt; &lt;td class="labels displayInput_noWidth"&gt;Middle Name&lt;/td&gt; &lt;td class="labels displayInput_noWidth"&gt;Aka&lt;/td&gt; &lt;td class="labels displayInput_75w"&gt;Birthday&lt;/td&gt; &lt;td class="labels displayInput_noWidth"&gt;Age&lt;/td&gt; &lt;/tr&gt; &lt;% foreach (var beneficiary in GetBenificiaries()) {%&gt; &lt;tr&gt; &lt;td&gt;&lt;%= beneficiary.BeneficiaryLastName %&gt;&lt;/td&gt; &lt;td&gt;&lt;%= beneficiary.BeneficiaryFirstName %&gt;&lt;/td&gt; &lt;td&gt;&lt;%= beneficiary.BeneficiaryMiddleName %&gt;&lt;/td&gt; &lt;td&gt;&lt;%= beneficiary.BeneficiaryAka %&gt;&lt;/td&gt; &lt;td&gt;&lt;%= beneficiary.BeneficiaryBirthday.ToString("MM/dd/yyyy")%&gt;&lt;/td&gt; &lt;td&gt; &lt;% DateTime.Now.Subtract(beneficiary.BeneficiaryBirthday).Days / 365%&gt;&lt;/td&gt; &lt;/tr&gt; &lt;%}%&gt; </code></pre> <p></p> <p>This way it is a lot more readable, you get strong typed intellisense, it matches more closely with MVC if you ever migrate, and if you use tools like resharper, they will be able to refactor these changes better</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload