set_value fires OnClientRating event

2 posts, 0 answers
  1. Amir
    Amir avatar
    2 posts
    Member since:
    Dec 2010

    Posted 01 Oct 2011 Link to this post


    I have a situation where I load a RadRating control alongside a video to allow users to rate it.  I have a client side method attached to the "OnClientRating" event to capture the user entry and save it into the database.

    Below it, I have a grid of other videos.  When a user clicks on the one of the videos in the grid, I get the current rating value for that video and try to set it to the rating control via the "Rating.set_value" client side api method.  However, this is causing the control to fire the "OnClientRating" event again, with the current value as the rating.  This causes a new "rating", but it was not initiated by the user, but rather via the the "set_value" method.

    Is there a way to NOT fire the OnClientRating event when executing the "set_value" method?  Or, is there another way I should approach this?

    Thank you.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 02 Oct 2011 Link to this post

    Hello Amir,

    Try setting args._cancel=true to not fire the OnClientRating event in Javascript.
    <script type="text/javascript">
    function OnClientRating(sender, args)
      //your code and condition

Back to Top