tags:

views:

586

answers:

2

Hi,

How can I attach a click event to a button and prevent postback?

The code I have doesn't seem to be working.

$('#btnNext').click(function() {
        return false;
    });
+5  A: 
$('#btnNext').click(function(e) {
        e.preventDefault();
    });
Marwan Aouida
I've noticed that this doesn't work either due to asp.net rendering. My button gets rendered with a "javascript:__doPostBack(". Any ideas on how to get rid of this?
Sir Psycho