title: asp.net error with <form id="form1" runat="server">
body: <p>i'm a newbie programmer
  i want to get rid of the traditional alert popup of javascript
  i found a pop up with a good gui but it doesn't work as expected in asp.net</p>
  
  <p>my problem is if i remove the</p>
  
  <pre><code>&lt;form id="form1" runat="server"&gt;
  </code></pre>
  
  <p>code it works perfectly</p>
  
  <p>but if i added it in asp.net with </p>
  
  <pre><code>&lt;form id="form1" runat="server"&gt;
  </code></pre>
  
  <p>the pop up doesn't work. after clicking the button it reloads the whole site instead of pop up the message. why?
  this is the whole code </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script type="text/javascript"&gt;
              /**
               * See how to limit only one dialog can be opened at a time.
               */
              $(function () {
                  var $btn = $('#btn-open');
                  $btn.on('click', function (event) {
                      BootstrapDialog.closeAll();
                      var dialog = new BootstrapDialog({
                          message: 'The only one.'
                      });
                      dialog.open();
                  });
              });
          &lt;/script&gt;</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>        &lt;style type="text/css"&gt;
              .floating-menu {
                  background-color: gray;
                  border: 1px solid blue;
                  padding: 20px;
                  position: absolute;
                  top: 10px;
                  right: 10px;
                  z-index: 9999;
              }
          &lt;/style&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      
      &lt;script src="https://code.jquery.com/jquery-2.1.4.min.js"&gt;&lt;/script&gt;
          &lt;link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" type="text/css" /&gt;
          &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"&gt;&lt;/script&gt;
          &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/run_prettify.min.js"&gt;&lt;/script&gt;
          &lt;link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.34.5/css/bootstrap-dialog.min.css" rel="stylesheet" type="text/css" /&gt;
          &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.34.5/js/bootstrap-dialog.min.js"&gt;&lt;/script&gt;
          &lt;link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"/&gt;
          &lt;title&gt;Only one dialog&lt;/title&gt;
          
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;div&gt;
      &lt;div class="floating-menu"&gt;
              &lt;button class="btn btn-primary" id="btn-open"&gt;Open dialog&lt;/button&gt;
          &lt;/div&gt;
          
      &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>