title: How do I switch visibility of a DIV in a repeater?
body: <p>I have a DIV inside my repeater as follows:</p>
  
  <pre><code>    &lt;asp:Repeater ID="topicView" runat="server" OnItemCommand="Delete_ItemCommand"&gt;
      &lt;ItemTemplate&gt;
      &lt;table width="945px" cellpadding="0" cellspacing="0" border="0" class="post-table"&gt;
          &lt;tr&gt;
              &lt;td colspan="2"&gt;
                  &lt;div class="post-info"&gt;
                      &lt;div class="post-info-left"&gt;&lt;%#DataBinder.Eval(Container.DataItem, "PostDate")%&gt;&lt;/div&gt;
                      &lt;div class="post-info-right"&gt;#&lt;%#DataBinder.Eval(Container.DataItem, "PostID")%&gt;&lt;/div&gt;
                      &lt;div class="clear"&gt;&lt;/div&gt;
                  &lt;/div&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td class="post-left"&gt;
                  &lt;p&gt;&lt;strong&gt;&lt;%#DataBinder.Eval(Container.DataItem, "Username")%&gt;&lt;/strong&gt;&lt;/p&gt;
              &lt;/td&gt;
              &lt;td class="post-right"&gt;
                  &lt;p&gt;&lt;%#DataBinder.Eval(Container.DataItem, "PostBody")%&gt;&lt;/p&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td colspan="2"&gt;
                  &lt;div class="post-edit"&gt;
                      &lt;p id="postEditAdmin" runat="server" visible="false"&gt;&lt;a class="fancybox.iframe fancybox" href='editpost.aspx?postID=&lt;%#DataBinder.Eval(Container.DataItem, "PostID")%&gt;'&gt;Edit&lt;/a&gt; | &lt;asp:LinkButton ID="deleteBtn" runat="server" Text="Delete" CommandName="Delete" OnClientClick="javascript:if(!confirm('Delete this information? this will delete permanently'))return false;" CommandArgument='&lt;%#DataBinder.Eval(Container.DataItem, "PostID")%&gt;' /&gt;&lt;/p&gt;
                      &lt;p id="postEdit" runat="server" visible="true"&gt;&lt;i&gt;You must be an admin to be able to edit or delete a post&lt;/i&gt;&lt;/p&gt;
                  &lt;/div&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>Can anyone let me know how to set the postEditAdmin.Visible to true and postEdit.Visible to false? It's not being picked up in the page load.</p>
  
  <p>Also please note it's going to be changed depending on an if statement. This is what I have so far:</p>
  
  <pre><code>        if (Session["role"].ToString() == "2")
          {
              postEditAdmin.Visible = true;
              postEdit.Visible = false;
          }
  </code></pre>