the asp:button works in two ways.
1) standard html submit button. to cancel your client code returns false on
the onclick:
<input type=submit onclick='return postbackcheck();'>
2) the input is render with a onclick call to '__dopostback', usually
checking validation. here you need to duplicate the code to cancel.
the supported approach is to write a custom validator, and turn on causes
vaidation on your button.
-- bruce (sqlwork.com)
<kr*********@gmail.comwrote in message
news:11**********************@16g2000cwy.googlegro ups.com...
>I have asp button control on the page. I need to check some condition
before I postback the page.
Actually it is posting back for both true, false conditions.
I want to postback only if the condition is true. otherwise I want to
stay on the same page.
Note: I have many other asp buttons controls should postback. I need to
check for the condition only for one asp button control.
Thanks.