title: ASP.NET to see if a number is even or odd
body: <p>I'm using the following code in a loop to find out if a variable is odd or even (only wanting to show the even results here) but I get the following error message "The left-hand side of an assignment must be a variable, property or indexer" for the line:</p>
  
  <pre><code>&lt;% if((leftCount % 2) = true) { %&gt;
  </code></pre>
  
  <p>Here is the code in full:</p>
  
  <pre><code>&lt;% var leftCount = 1;  %&gt;           
              &lt;% foreach (var i in DevelopmentJobs) { %&gt;
                  &lt;% if((leftCount % 2) = true) { %&gt;
                  DO SOMETHING
                  &lt;% } %&gt;
  
                  &lt;% } %&gt;
             &lt;% leftCount++; %&gt;
  </code></pre>
  
  <p>Thanks</p>