title: ASP.NET C# <asp:Button type="button"> but still acting like <asp:Button type="submit">
body: <pre><code>&lt;asp:Button runat="server" id="LoginBtn" type="Button" Text="Login" OnClientClick="document.getElementById('jsLogin').style.display='inline-grid'" /&gt;
  </code></pre>
  
  <p>As the title states, the above line of code is what is present in my Master.master page.</p>
  
  <p>But when I run the debugger (visual studio 2017), chrome and the application run the button with a postback, and when I examine the element, it's still showing </p>
  
  <pre><code>&lt;input type="submit" name="ctl00$LoginBtn" value="Login" onclick="document.getElementById('jsLogin').style.display='inline-grid';" id="LoginBtn"&gt;
  </code></pre>
  
  <p>I have <em>zero</em> clue what to do.</p>
  
  <p><em>UPDATE 7/19/2018 (20 minutes later)</em></p>
  
  <p>reverted to an older source control:</p>
  
  <p>the only change was near the top of the master.master:</p>
  
  <pre><code>&lt;html lang="en-us"&gt;
      &lt;form runat="server"&gt;
          &lt;head runat="server"&gt;
              &lt;asp:scriptmanager runat="server"&gt;&lt;/asp:scriptmanager&gt;
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>&lt;html lang="en-us"&gt;
      &lt;head runat="server"&gt;
          &lt;form runat="server"&gt;
              &lt;asp:scriptmanager runat="server"&gt;&lt;/asp:scriptmanager&gt;
  </code></pre>
  
  <p>and on the Default.aspx page this line:</p>
  
  <pre><code>&lt;%@ MasterType VirtualPath="~/Master.master" %&gt;
  </code></pre>
  
  <p>is not commented out.</p>
  
  <p>Literally nothing else changed O.o  Someone who knows more about ASP.Net than me please clue me in.</p>
  
  <p><em>Update 7/20/2018 - 18:39 gmt</em></p>
  
  <p>Reproduced the root cause.</p>
  
  <pre><code>&lt;asp:textbox&gt;
  </code></pre>
  
  <p>was set to <em>required</em>.  I removed the <em>required</em> and created a custom javascript function.  Apparently there is a problem with FormsAuthentication.Signout() when you try to clear authentication on hidden forms that have <em>required</em> set.</p>
  
  <pre><code>&lt;script&gt;
      function validation() {
          var username = document.getElementById('uNameLogin').value;
          var password = document.getElementById('uPasswordLogin').value;
          if (username == null || password == null || username == "" || password == "") 
          {
              document.getElementById('uNameLogin').value = "User Name &amp; Password Required!";
              return false;
          }
       }
  &lt;/script&gt;
  </code></pre>
  
  <p>after adding that, to prevent the post back I followed the suggestion of adding <em>return false</em> to the OnClientClick javascript:</p>
  
  <pre><code>OnClientClick="javascript:document.getElementById('jsLogin').style.display='inline-grid'; return false;"
  </code></pre>
  
  <p>and it resolved the problem of the Login button causing postback.</p>