Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Rating > set_value fires OnClientRating event

Not answered set_value fires OnClientRating event

Feed from this thread
  • Amir avatar

    Posted on Oct 1, 2011 (permalink)

    Hello,

    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.

    Reply

  • Posted on Oct 2, 2011 (permalink)

    Hello Amir,

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

    Thanks,
    Princy.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Rating > set_value fires OnClientRating event
Related resources for "set_value fires OnClientRating event"

ASP.NET Rating Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]