title: Jquery Hide with asp.net postback
body: <p>I have the following code.....</p>
  
  <pre><code>&lt;head&gt;
  &lt;script src="Scripts/jquery-1.7.2.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="Scripts/hidepanel.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div id="outboundForm"&gt;
      &lt;p&gt;
          &lt;asp:Button ID="btnSubmit" ClientIDMode="Inherit" runat="server" TabIndex="17" CssClass="btnSubmit"
              OnClick="btnSubmit_Click" meta:resourcekey="btnSubmitResource1" /&gt;
          &lt;asp:Button ID="btnReset" runat="server" CssClass="btnReset" OnClick="btnReset_Click"
              meta:resourcekey="btnResetResource1" /&gt;
      &lt;/p&gt;
  &lt;/div&gt;
  &lt;div id="MailPreviewDiv"&gt;
      &lt;asp:Label ID="lblPreview" runat="server" Visible="false" Text="" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>my hidepanel.js looks like this....</p>
  
  <pre><code>$(document).ready(function () {
      d = new Date();
      d = d.getTime();
      if ($('#reloadValue').val().length == 0) {
          $('#reloadValue').val(d);
          $('#MailPreviewDiv').
      } else {
          $('#reloadValue').val('');
      }
  
      $('#MainContent_btnSubmit').click(function () {
          $('#outboundForm').hide("slow");
          $('#MailPreviewDiv').show("slow");
      });
  });
  </code></pre>
  
  <p>Now, by default i would like <code>MailPreviewDiv</code> to be hidden and ONLY when i click <code>btn_submit</code> do i want the <code>MailPreviewDiv</code> to be seen. this works fins with traditional HTML but as soon as i add this to .NET crazy things happen. When i click submit i can see the transition take place but then i am left with both div's still being displayed and the <code>outboundForm</code> div is still visible.</p>
  
  <p>What i have observed is that the javascript even gets fired and then after my .net mouse click even is fired, after which i can see a transition and am left with both div's visible. Can anybody offer some advice please...</p>
  
  <p>This may have something to do with a partial postback happening but i am not sure....</p>