Using onitemclick and OnClientItemClicked together

2 posts, 0 answers
  1. Fred Parcells
    Fred Parcells avatar
    5 posts
    Member since:
    Oct 2009

    Posted 31 Aug 2010 Link to this post

    RadRotator Using onitemclick and OnClientItemClicked together
    I check for condition and get an alert box with OnClientItemClicked, then do postback with onitemclick. Works fine in IE7. In Firefox3 I get  __doPostBack is not defined. What is the work around for Firefox?
    Thanks
    Fred

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 01 Sep 2010 Link to this post

    Hello,


    You could use the 'OnClientItemClicking' event to check the condition and if the condition fails, cancel the event using args.set_cancel(true) method, instead of invoking postback explicitly.

    function OnClientItemClicking(sender, args) {
        // Check for condition
        args.set_cancel(true);  // Cancel the event
     
    }


    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top