title: How can I preventDefault on HTML.ActionLink?
body: <p>In my master page I have the following ActionLink:</p>
  
  <pre><code> &lt;%=Html.ActionLink("Reset State", "ResetState", "State", null, new { id = "resetButton" })%&gt;
  </code></pre>
  
  <p>In my view, which inherts from this master page, I have the following click event defined:</p>
  
  <pre><code> $(document).ready(function () {
      $("#resetButton").click(function (e) {
          var context = org.testportal.context;
          var appId = context.currentApplicationId;
          var userId = context.currentUserId;
          var hwid = context.currentHwid;
  
          if (contextIsValid()) {
              $.get('/State/ResetState', { applicationId: appId, userId: userId, hwid: hwid },
     function (data) {
         openDialogBox(data);
     }, "json");
          }
          else {
              var data = { message: "Invalid Context" };
              openDialogBox(data);
          }
          e.preventDefault();
      }); //resetState
  });
  </code></pre>
  
  <p>Currently, when the user clicks the link, "Reset State" the link makes GET request to my controller action with NULL parameters. The click event is never raised and the event default is not stopped (so it would appear). The above javascript is added in the footer of my view.</p>
  
  <p>Using Firebug I can see that the event is bound on $(document).ready(). At this time $("#resetButton") is found on the page. I made sure of this using a watch when the event is bound. </p>
  
  <p>Any ideas on why my js might not be firing? </p>
  
  <p>Thanks</p>
  
  <p><strong>Disregard</strong></p>
  
  <p>I'm a dingle. I found a js error in the script.</p>