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

Razor Page

This article describes how to configure the Telerik UI ButtonGroup HtmlHelper for ASP.NET Core in a RazorPages scenario.

See the ButtonGroup configuration in the example below, and for the full project with RazorPages examples, visit our GitHub repository.

@page
@model Telerik.Examples.RazorPages.Pages.ButtonGroup.ButtonGroupIndexModel
@{
    ViewData["Title"] = "ButtonGroupIndex";
}

@inject Microsoft.AspNetCore.Antiforgery.IAntiforgery Xsrf
@Html.AntiForgeryToken()

<h1>ButtonGroupIndex</h1>

@(Html.Kendo().ButtonGroup()
    .Name("buttonGroup")
    .Items(t =>
    {
        t.Add().Text("Month");
        t.Add().Text("Quarter");
        t.Add().Text("Year");
    })
    .Events(ev => ev.Select("onSelect"))
)

<script>
    function onSelect(e) {
        console.log("selected index:" + e.indices);
    }
</script>
    public class ButtonGroupIndexModel : PageModel
    {
        public void OnGet()
        {

        }
    }

See Also

In this article
Not finding the help you need? Improve this article