PostBack Event

Discussion in 'ASP .Net' started by Raj, May 24, 2004.

  1. Raj

    Raj Guest

    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.
    Raj, May 24, 2004
    #1
    1. Advertising

  2. Raj

    Raterus Guest

    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.


    "Raj" <> wrote in message news:...
    > 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.
    >
    >
    >
    >
    >
    >
    Raterus, May 24, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Lingen
    Replies:
    5
    Views:
    13,612
  2. Psych971
    Replies:
    5
    Views:
    4,590
    bruce barker
    Dec 17, 2004
  3. =?Utf-8?B?Q2hhZA==?=

    Postback not being set to True on first postback

    =?Utf-8?B?Q2hhZA==?=, Apr 4, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    480
    =?Utf-8?B?Q2hhZA==?=
    Apr 4, 2005
  4. gce
    Replies:
    2
    Views:
    1,691
  5. Jacky Chau
    Replies:
    2
    Views:
    2,021
    Ninjamyst
    Jun 8, 2005
Loading...

Share This Page