ASP.NET Core Rating Overview

Telerik UI for ASP.NET Core Ninja image

The Rating is part of Telerik UI for ASP.NET Core, a professional grade UI library with 110+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.

The Telerik UI Rating TagHelper and HtmlHelper for ASP.NET Core are server-side wrappers for the Kendo UI Rating widget.

The Rating allows to intuitively rate by selecting number of items stars from a predefined maximum number of items.

Initializing the Rating

The following example demonstrates how to define the Rating.

    @(Html.Kendo().Rating()
        .Name("rating")
    )
    <kendo-rating name="rating"></kendo-rating>

Basic Configuration

The following example demonstrates the basic configuration for the Rating.

    @(Html.Kendo().Rating()
        .Name("rating")
        .Min(1)
        .Max(6)
        .Value(3)
    )

    <script>
    $(function() {
        // The Name() of the Rating is used to get its client-side instance.
        var rating = $("#rating").data("kendoRating");
    });
    </script>
    <kendo-rating name="rating" min="1" max="6" value="3"></kendo-rating>

Functionality and Features

Events

You can subscribe to all Rating events.

    <kendo-rating name="rating" on-change="onChange" on-select="onSelect"></kendo-rating>

    <script>
        function onChange(e) {
            console.log(e);
        }

        function onSelect(e) {
            console.log(e);
        }
    </script>

See Also

In this article