title: The control didnt' hide even the script is run
body: <p>I have 2 panels on aspx pages. When the page is load, the step1 panel is shown. After the user click the button. I check the data and show the step2 panel in which I show the data into repeater control in code behind. There is a "Back" button. When user clicks this button, I need to hide the step 2 panel and show the step1 panel again. My problem is when the user click the back button. I can see the step1 is shown but gone then the step2 panel is still there.  Would someone help me to solve this issue. Thanks in advance</p>
  
  <p>There is my aspx page:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;asp:panel id="pnlStep1" runat="server" visible="False"  &gt;   
  &lt;asp:label id="lbl" text="The order is ....."/&gt; 
    &lt;asp:Button id="btnNext" runat="server" text="Next" cssclass="btn"/&gt;
  &lt;/asp:panel&gt;
  
  &lt;asp:panel id="pnlStep2" runat="server" visible="False"  &gt;            
    &lt;fieldset class="fldBoxy"&gt;&lt;legend class="fldLegend"&gt;Conflicts&lt;/legend&gt;
      &lt;table class="tbl w100p" border="0"&gt;
        &lt;tr&gt;
          &lt;td class="field100"&gt;
            &lt;asp:repeater id="repConflicts" runat="server" &gt;
              &lt;itemtemplate&gt;
                &lt;%# DataBinder.Eval(Container.DataItem, "Details") %&gt;
                &lt;br/&gt;
              &lt;/itemtemplate&gt;
            &lt;/asp:repeater&gt;
            &lt;asp:label id="lblNoConflicts" runat="server" visible="False" text="No conflicts were found."&gt;&lt;/asp:label&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/fieldset&gt;
  
    &lt;div class="savechanges"&gt;
      &lt;table class="w100p" &gt;
        &lt;tr&gt;
          &lt;td class="talgnL" &gt;&lt;asp:Button ID="btnBack"  Text="Back" runat="server" CssClass="btn" OnClientClick="hideStep2()"/&gt;
          &lt;/td&gt;
          &lt;td&gt;
            &lt;asp:Button id="btnSave" runat="server" text="  Change" cssclass="btn"  /&gt;
           &lt;input class=" btn" onclick="self.close();" type="button" value="Cancel" /&gt;
          &lt;/td&gt;
          &lt;td&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/div&gt;
  &lt;/asp:panel&gt;
  </code></pre>
  
  <p>There is my javascritp:</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
    function hideStep2(){
      var pln = document.getElementById("pnlStep2");
      if (pln != 'undefined') {
        alert('24');                   
        pln.style.visibility = "hidden";
        pln.style.display = "none";   
        document.getElementById("pnlStep1").style.display = "block";
      }
    }
  &lt;/script&gt;
  </code></pre>