title: Collapse Panel on postback in asp.net
body: <p>I have two panels with a gridview in each. I want to expand panels on pageload but if I collapse one of the panel later I want the planel to stay collapsed on postback when I update gridview in other panel. I am trying to do this without javascript, is there a easy way to do this?</p>
  
  <p>Code structure looks like this:</p>
  
  <pre><code>&lt;asp:Panel id="1" runat="server"&gt;  //panel 1
         &lt;table&gt;
             &lt;tr&gt;&lt;td&gt;
                 &lt;asp:GridView id="grid1" runat="server"&gt;&lt;/asp:GridView&gt;
             &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;
   &lt;/panel&gt;
  
   &lt;asp:Panel id="Panel2" runat="server"&gt;  //Panel2
           &lt;table&gt;
              &lt;tr&gt;&lt;td&gt;
                  &lt;asp:GridView id="Grid2" runat="server"&gt;&lt;/asp:GridView&gt;
              &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;
  &lt;/panel&gt;
  </code></pre>