title: what should I do at vb.net to display my modal pop up
body: <pre><code>&lt;asp:Button ID="btnupdate" runat="server" Text="UPDATE" ValidationGroup="check" /&gt;
  
          &lt;div id="msgdiv" class="modal"&gt;
              &lt;!-- Modal content --&gt;
              &lt;div class="modal-content"&gt;
                  &lt;span class="close"&gt;×&lt;/span&gt;
                  &lt;p&gt;
                      update ok confirm pls login again!!!!!!&lt;/p&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
       &lt;script&gt;
  
  
          var modal = document.getElementById('msgdiv'); 
  
  
          var btn = document.getElementById("btnupdate"); 
  
  
          var span = document.getElementsByClassName("close")[0];
  
          btn.onclick = function () {
              modal.style.display = "block";
          }
  
          span.onclick = function () {
              modal.style.display = "none";
          }
  
      &lt;/script&gt;
  </code></pre>
  
  <p>This code is for the modal pop up message.
  When I click on the button it should show the modal pop up then when I click the "x" button then it should close.</p>
  
  <p>The problem is when you click on the update button it shows the modal pop up but immediately goes off. "its like, it is there but not"</p>
  
  <p>Should I do anything at back-end code or it can be fixed in front-end code, and how?</p>