title: onClientClick not working when calling a jQuery function
body: <p>I want to trigger a jQuery form display when a user clicks on an ASP.NET server-side button.</p>
  
  <p>However when I click on the button at runtime, the page just reloads really quick .. No jQuery form opening ..</p>
  
  <p>The effect I'm trying to create can be seen here: <a href="http://jsfiddle.net/ahmadka/khSxK/3/" rel="nofollow">JSFiddle</a></p>
  
  <p>Basically I want to open the same dialog box when someone clicks on the ASP.NET button ..</p>
  
  <p>This is my code:</p>
  
  <pre><code>&lt;script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"&gt;&lt;/script&gt;
  
  &lt;asp:Button ID="createuser" runat="server" Text="Button" OnClientClick='$("#dialogform").dialog("open");'/&gt;
  
  
  &lt;script type="text/javascript"&gt;
  
  $(function() {
  
      $( "#dialogform" ).dialog({
        autoOpen: false,
        height: 300,
        width: 450,
        modal: true,
        buttons: {
          "Create an account": function() {
            alert('Hello');
          },
          Cancel: function() {
            $( this ).dialog( "close" );
          }
        },
        close: function() {
          $( this ).dialog( "close" );
        }
      });
    });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>I have also tried using <code>jQuery</code> instead of the <code>$</code> identifier to call jQuery functions. And I've also tried to remove the <code>onClientClick</code> event, and tried using this code instead for the script block above:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  $(function() {
  
      $( "#dialogform" ).dialog({
        autoOpen: false,
        height: 300,
        width: 450,
        modal: true,
        buttons: {
          "Create an account": function() {
            alert('Hello');
          },
          Cancel: function() {
            $( this ).dialog( "close" );
          }
        },
        close: function() {
          $( this ).dialog( "close" );
        }
      });
  
      $( "#createuser" )
        .button()
        .click(function() {
          $( "#dialogform" ).dialog( "open" );
        });
    });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Can anyone identify what's the problem ?</p>