Disable click on table rows

Disable click on table rows

I'm trying to disable the onclick event on a ASP.NET gridview that generates following HTML markup:

  1. <table id="GridViewPP" >
  2. <tr >
  3. <th scope="col">PP</th>
  4. </tr>
  5. <tr class="SelectedRow" onclick="javascript:__doPostBack('GridViewPP','Select$0')">
  6. <td align="center">N</td>
  7. </tr>
  8. </table>
I used the following code, but the mouse click would still postback, triggering the SelectedIndexChanged event on the server-side:

  1.                 $("table#GridViewPP tr").click(function(event) {
  2.                     alert("click");
  3.                     this.onclick = null;
  4.                     event.preventDefault();
  5.                     event.returnValue = false;
  6.                     return false;
  7.                 });
It seems the postback has occurred prior to the jQuery code kicked in. How can I prevent the postback? Thanks.

Quan