title: Jquery Dialog with asp.net
body: <p>When i click on button to show the message i get one MessageBox that's normal but when i call the Jquery Dialog for the SCOND time i get two MessageBoxs! and when i call Jquery Dialog for the third time i get three MessageBoxs! Please help me!</p>
  
  <p>Here is my Code:</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&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;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/start/jquery-ui.css"
          rel="stylesheet" type="text/css" /&gt;
      &lt;script type="text/javascript"&gt;
          $(document).ready(function () {
              $("[id*=Call_Dialog]").click(function() {
  
                  $("#MyDiv").dialog({
                      title: "jQuery Dialog Popup",
                      buttons: {
                          Close: function () {
                              $(this).dialog('close');
                          }
                      }
                  });
  
                  $("#ShowMessage").click(function () {
                      event.preventDefault();
                      alert('Hi');
                      $("#MyDiv").dialog('close');
                  })
              })
          });
      &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;div id="MyDiv" style="display: none"&gt;
  
  &lt;asp:Button ID="ShowMessage" runat="server" Text="Button" /&gt; 
  
      &lt;/div&gt;
  
  
  
      &lt;/form&gt;
      &lt;p&gt;
          &lt;input id="Call_Dialog" type="button" value="button" /&gt;&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>