title: Set visible to true in repeater using inline code
body: <p>I need to randomly set visible of row(index between 2 to 7) in a repeater to true. </p>
  
  <p>I tried to declare a random number, when item index is equal to the random number, then set it to true</p>
  
  <pre><code>&lt;div id="divSomething" runat="server" class="pull-center" visible=&lt;%# (int r = new Random().Next(2, 7)) == Container.ItemIndex + 1) ? true : false %&gt;&gt;
  </code></pre>
  
  <p>But doesn't work. Any other way to achieve this?</p>