New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

OnClientRated

The OnClientRated event is raised after you click an item of the RadRating control therefore after the OnClientRating event. It is not cancellable. If you cancel the OnClientRating event, it will not be fired.

This event can be used to perform a specific operation based on the value that is set to the rating control.

The event handler receives two arguments:

  1. Sender – the RadRating object that fired the event.

  2. Event arguments – an event arguments object that exposes the following properties and methods:

Client-side methods of the event arguments object.

Name Parameters Return Type Description
get_oldValue number The method returns an object of type number. It shows the value of the rating control before clicking on the rating item. In Example 1 you can check how to indicate if there is a change in the value of the rating via this method.

Example 1 : Using the OnClientRated event.

<telerik:RadRating RenderMode="Lightweight" runat="server" ID="RadRating3" OnClientRated="OnClientRated"></telerik:RadRating>
<span id="message"></span>
<script type="text/javascript">
    function OnClientRated(sender, args) {
        $get("message").innerHTML = (args.get_oldValue() == sender.get_value()) ? "The value is not changed." : "";
    }
</script>
In this article