Aborting server side event handler depending on client

3 posts, 1 answers
  1. Daniel
    Daniel avatar
    16 posts
    Member since:
    Mar 2011

    Posted 08 Apr 2011 Link to this post

    Hi,

    Any help on this matter would be greatly appreciated, I have been stuck on it for a good while now.

    I have a radtoolbar, I have two events handled:

    OnClientButtonClicked="RadToolBar_ClientButtonClicked"
    OnButtonClick="RadToolBar_ButtonClick" 

    Depending on the outcome of the RadToolBar_ClientButtonClicked method (javascript) I would like to/not to handle the OnButtonClick event using the RadToolBar_ButtonClick (c#) - that is, if the client-side method returns false I would like the server-side method to just not execute (I don't even want an alternative method to run, just want it to do nothing).

    I have tried the following..

    OnClientButtonClicked="return RadToolBar_ClientButtonClicked()"
    and
    OnClientButtonClicked="return RadToolBar_ClientButtonClicked();"

    ...but on doing this the page simply does not load (remains blank white).

    Thanks a LOT!!!

    Dan
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 08 Apr 2011 Link to this post

    Hello Daniel,


    You could attach OnClientButtonClicking event to RadToolBar, and use the args.set_canel(true) method to cancel the event.
    OnClientButtonClicking



    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Daniel
    Daniel avatar
    16 posts
    Member since:
    Mar 2011

    Posted 08 Apr 2011 Link to this post

    EDITED: F*cking brilliant Princy!! Been at that for hours now mate, appreciate it!!
Back to Top