PostBack Event

R

Raj

Hi,
I have a Web form on which there are two Radio buttons, AutoPostBack
Property for both is set to true.
Also there is a Javascript function attached to each of these radio
button.

The requirement is that if the javascript function returns false, I
don't want the Postback event to execute.
Currently the problem is that AutoPostBack is occuring irrrespectve of
the return value from javascript function.
How do I prevent the postback if the Javascript function returns false.


Thanks.
 
R

Raterus

returning a value of 'False' to an onClick handler will stop anything else from executing

onClick='javascript:return false; __doPostBack(...)'

__doPostBack would never be called in this onClick handler.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top