Sunset skin

Rating - Client-Side Events


Event log

Demo Configurator

  • Set RadRating Selected Value:
Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

This example demonstrates the client-side functionality of the RadRating control.

See the help section for detailed information about RadRating's client-side events and API.

Client-side events:

  • OnClientLoad - raised when the Rating control is initialized.
  • OnClientRating - raised when the user is rating and before the new value is set to the control.
  • OnClientRated - raised after the user has rated.
  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • scripts.js
  • styles.css
<%@ Page Language="c#" AutoEventWireup="true" Inherits="Telerik.Web.Examples.Rating.ClientSideFunctionality.DefaultCS"CodeFile="DefaultCS.aspx.cs"  %>

<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">
<html xmlns=''>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link href="styles.css" rel="stylesheet" />
    <script src="scripts.js" type="text/javascript"></script>
    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">

        <script type="text/javascript">
            function getRatingObject() {
                return $find("<%=RadRating1.ClientID %>");

            function getTextValue() {
                return $get("<%=txtValue.ClientID %>");

            function getCancelCheckBox() {
                return $get("<%=cbCancel.ClientID %>");
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container size-thin">
            <span style="line-height: 250%;">RadRating:</span>
            <telerik:RadRating RenderMode="Lightweight" ID="RadRating1" runat="server" Precision="Exact" SelectionMode="Continuous"
                OnClientLoad="OnClientLoad" OnClientRating="OnClientRating" OnClientRated="OnClientRated"
            <br />
    <qsf:EventLogConsole ID="EventLogConsole1" runat="server" AllowClear="true"></qsf:EventLogConsole>
    <qsf:ConfiguratorPanel runat="server">
                <ul class="fb-group">
                        <asp:CheckBox ID="cbCancel" runat="server" Text="Cancel OnClientRating (If checked the rating does not occur.)"></asp:CheckBox></li>
                        <asp:CheckBox ID="cbReadOnly" runat="server" onclick="SetReadOnly();" Text="Make RadRating ReadOnly"></asp:CheckBox></li>
                    <li>Set RadRating Selected Value:</li>
                        <qsf:TextBox ID="txtValue" runat="server" Width="100"></qsf:TextBox>&nbsp;
            <qsf:Button ID="btnValue" runat="server" OnClientClicked="setValue" AutoPostBack="false"

Support & Learning Resources

Find Assistance

Help Us Improve

Was this example helpful?