title: Using mod operator in C#
body: <p>Items:</p>
  
  <p>1 2 3 <strong>4</strong> 5 6 7 <strong>8</strong> 9 10 11 <strong>12</strong> 13 14 15 <strong>16</strong> 17 18</p>
  
  <hr>
  
  <p>Repeater control I want to place class on highlighted item number.</p>
  
  <p>so ... I have done following code.</p>
  
  <pre><code>if ((DL_NewProducts.Items.Count) % 3 == 0)
  {
      var libox = e.Item.FindControl("libox") as HtmlGenericControl;
      if (libox != null)
          libox.Attributes["class"] = "last";
  }
  </code></pre>
  
  <p>Here is problem that in first iteration it find three items, mod work fine and it place class on 4th item but in second iteration it come again on 6th item and place class on 7th item while I want it to place it on 8th what will be correct logic for it..</p>