title: MVC 3 Ajax.ActionLink with JQuery UI Confirm Dialog
body: <p>I have a @Ajax.ActionLink which calls a Delete Action. Now I want to use JQuery UI Dialog confirm instead the regular "Confirm" attribute of the Ajax link. 
  I hook the event to the Ajax.ActionLink using the unobtrusive javaScript. But the action gets submitted and the  e.preventDefault(); throughs an error. Can anyone tell me why this happens?</p>
  
  <p>Here is my jQuery code:</p>
  
  <pre><code> $("[data-dialog-confirm]").click(function (e) {
  
          e.preventDefault();
          var theHREF = $(this).attr("href");
          $("#dialog-confirm").dialog('option', 'buttons', {
              "Delete this item": function () {
                  window.location.href = theHREF;
                  $(this).dialog("close");
              },
              "Cancel": function () {
                  $(this).dialog("close");
              }
          });
          $("#dialog-confirm").dialog("open");
      });
  </code></pre>
  
  <hr>
  
  <p>Here is my MVC code:</p>
  
  <pre><code>    @Ajax.ActionLink("Delete", "DeleteConfirmed", new { id = item.Id },
                      new AjaxOptions
                      {
                          HttpMethod = "POST",
                          OnSuccess = "refreshList"
                      },
                      new {data_dialog_confirm="true" }
                      )
  </code></pre>