title: How to hide <div> tag using jquery in asp.net ?
body: <p>I am trying to hide a div tag using jquery but I don't no why it is not hiding .
  I am using  Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1069.1.
  When page load then div tag with id 'Panel2' show hide and
  Whenever I click  on button then div tag with id 'Panel2' should show.
  But it is not happening like that...when the page load it hide that div tag  but when I click on button it show the div tag only for 2 seconds after that it hide(i.e. comes back its hide state).
  I have heard that jquery doesn't work properly with .aspx .I don't know why If so then what is the solution ?</p>
  
  <p>Problem is with line number 47 to 54(i.e. the query of hiding the div tag is between these lines)
  Here is what I have tried :- </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="demopractice.aspx.cs" Inherits="Student_demopractice" %&gt;
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;&lt;/title&gt;
  
      &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.8.3/themes/base/jquery-ui.css" /&gt;
  &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://code.jquery.com/ui/1.8.3/jquery-ui.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      var currentTab = 0;
      $(function () {
          $("#tabs").tabs({
              select: function (e, i) {
                  currentTab = i.index;
              }
          });
      });
      $("#btnNext").live("click", function () {
          var tabs = $('#tabs').tabs();
          var c = $('#tabs').tabs("length");
          currentTab = currentTab == (c - 1) ? currentTab : (currentTab + 1);
          tabs.tabs('select', currentTab);
          $("#btnPrevious").show();
          if (currentTab == (c - 1)) {
              $("#btnNext").hide();
          } else {
              $("#btnNext").show();
          }
      });
      $("#btnPrevious").live("click", function () {
          var tabs = $('#tabs').tabs();
          var c = $('#tabs').tabs("length");
          currentTab = currentTab == 0 ? currentTab : (currentTab - 1);
          tabs.tabs('select', currentTab);
          if (currentTab == 0) {
              $("#btnNext").show();
              $("#btnPrevious").hide();
          }
          if (currentTab &lt; (c - 1)) {
              $("#btnNext").show();
          }
      });
  
      $(function () {
          $("#Panel2").hide();
  
          $("#Button1").click(function() {
              if ($('#Panel2').is(":hidden")) {
                  $('#Panel2').show();
              }
              });
  
          });
  &lt;/script&gt;
  
  
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;div&gt;
  
  
          &lt;div id="tabs"&gt;
      &lt;ul&gt;
          &lt;li&gt;&lt;a href="#tabs-1"&gt;Tab 1&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#tabs-2"&gt;Tab 2&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#tabs-3"&gt;Tab 3&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#tabs-4"&gt;Tab 4&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#tabs-5"&gt;Tab 5&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;div id="tabs-1"&gt;
  
          &lt;asp:Panel ID="Panel1" runat="server"&gt;
  
              &lt;asp:Label ID="Label1" runat="server" Text="Label"&gt;&lt;/asp:Label&gt;
              &lt;br /&gt;
              &lt;br /&gt;
              &lt;br /&gt;
             &lt;span&gt;A-&lt;/span&gt; &lt;asp:Label ID="Label2" runat="server" Text="Label"&gt;&lt;/asp:Label&gt;
              &lt;br /&gt;
              &lt;br /&gt;
              &lt;span&gt;B-&lt;/span&gt; &lt;asp:Label ID="Label3" runat="server" Text="Label"&gt;&lt;/asp:Label&gt;
              &lt;br /&gt;
              &lt;br /&gt;
              &lt;span&gt;C-&lt;/span&gt; &lt;asp:Label ID="Label4" runat="server" Text="Label"&gt;&lt;/asp:Label&gt;
              &lt;br /&gt;
              &lt;br /&gt;
              &lt;span&gt;D-&lt;/span&gt; &lt;asp:Label ID="Label5" runat="server" Text="Label"&gt;&lt;/asp:Label&gt;
              &lt;br /&gt;
              &lt;br /&gt;
              &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
              &lt;asp:Button ID="Button1" runat="server" Text="Show Answer" OnClick="Button1_Click" /&gt;
              &lt;br /&gt;
  
              &lt;div id="Panel2" runat="server"&gt;
  
                  &lt;span&gt;Correct Answer is :-&lt;/span&gt;&lt;asp:Label ID="Label6" runat="server" Text="Label"&gt;&lt;/asp:Label&gt;
                  &lt;br /&gt;
                  &lt;br /&gt;
                  &lt;asp:Label ID="Label7" runat="server" Text="Label"&gt;&lt;/asp:Label&gt;
  
  
              &lt;/div&gt;
  
  
          &lt;/asp:Panel&gt;
      
      &lt;/div&gt;
      &lt;div id="tabs-2"&gt;
          Tab 2 Content
      &lt;/div&gt;
      &lt;div id="tabs-3"&gt;
          Tab 3 Content
      &lt;/div&gt;
       &lt;div id="tabs-4"&gt;
          Tab 4 Content
      &lt;/div&gt;
       &lt;div id="tabs-5"&gt;
          Tab 5 Content
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;input type="button" id="btnPrevious" value="Previous" style = "display:none"/&gt;
  &lt;input type="button" id="btnNext" value="Next" /&gt;
  
      
      &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>