First Steps in Telerik UI for ASP.NET Core with CLI
This tutorial shows how to create an ASP.NET Core web application that uses Telerik UI for ASP.NET Core components using the .NET command-line interface (CLI)
You will learn how to create a sample application and add a Telerik UI for ASP.NET Core DatePicker component using either HtmlHelper or TagHelper syntax.
The suggested approach is platform-agnostic—you can apply it for macOS, Linux, and Windows. The steps are applicable for .NET Core projects in Visual Studio Code.
Follow these steps to create and configure your ASP.NET Core application with Telerik UI components:
- Check the prerequisites
- Install a license key
- Create the ASP.NET Core application
- Integrate UI for ASP.NET Core in the project
- Add a component.
Prerequisites
- .NET Core SDK
- Telerik account—if you don't have an account yet, you can create one for free.
Installing a License Key
Starting with Telerik UI for ASP.NET Core 2025 Q1 release, you must activate the UI components by providing a license key file. Previous versions require a script key instead of a license key file.
To download and install your Telerik license key:
- Go to the License Keys page in your Telerik account.
- Click the Download License Key button.
- Save the
telerik-license.txtfile to:- (on Windows)
%AppData%\Telerik\telerik-license.txt, for example,C:\Users\...\AppData\Roaming\Telerik\telerik-license.txt - (on Mac or Linux)
~/.telerik/telerik-license.txt, for example,/Users/.../.telerik/telerik-license.txt
- (on Windows)
This will make the license key available to all Telerik .NET apps that you develop on your local machine.
The Telerik License Key article provides additional details on installing and updating your Telerik license key in different scenarios. Automatic license key maintenance is more effective and recommended in the long run.
Creating the Application
- If you are configuring an existing project, skip this step.
- For the full list of current commands, refer to the Microsoft guide on getting started with .NET Core.
-
Navigate to the folder of your choice by using the Terminal (cmd). Create a new folder and navigate in it.
batchmkdir MyASPNETCoreProject cd MyASPNETCoreProject -
Create a .NET Core application with the default web MVC template by running
dotnet new mvc. The following example demonstrates a sample response that you are expected to receive.batchdotnet new mvc Getting ready... The template "ASP.NET Core Web App (Model-View-Controller)" was created successfully. -- Restore succeeded. -
Start the application by running
dotnet run. The following example demonstrates a sample response that you are expected to receive.batchdotnet run Now listening on: http://localhost:5000 Application started. Press Ctrl+C to shut down. -
By using the browser, navigate to the above location and make sure that the application is properly running. After you check the application in the browser, stop the server with
Ctrl+C.
Integrating UI for ASP.NET Core
-
Configure the private Telerik NuGet feed in the
NuGet.Configfile:-
Ensure you are editing the correct and desired config file. You can also create a new one with the
dotnet new nugetconfigcommand. -
Add the Telerik package source to the config file. For the authentication, use your NuGet API key as a password and
api-keyas a username. Add the API key in plain text, because the NuGet tooling does not fully support encrypted credentials. Here is an example of how yourNuGet.Configfile can look like:
XML<?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <!--To inherit the global NuGet package sources remove the <clear/> line below --> <clear /> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> <add key="telerik.com" value="https://nuget.telerik.com/v3/index.json" /> </packageSources> <packageSourceCredentials> <telerik.com> <add key="Username" value="api-key>" /> <add key="ClearTextPassword" value="YOUR-NUGET-API-KEY" /> </telerik.com> </packageSourceCredentials> </configuration> -
-
Install Telerik UI for ASP.NET Core through the CLI by running
dotnet add package Telerik.UI.for.AspNet.Core. -
Register the Kendo UI service in the services container.
- For applications using .NET 6 and the minimal hosting model, open the
Program.csfile and register the Kendo UI service.
C#var builder = WebApplication.CreateBuilder(args); // Add Kendo UI services to the services container. builder.Services.AddKendo();- For applications using .NET 5 or earlier, open the
Startup.csfile and register the Kendo UI services in theConfigureServicesmethod.
C#public void ConfigureServices(IServiceCollection services) { // Add the Kendo UI services to the services container. services.AddKendo(); } - For applications using .NET 6 and the minimal hosting model, open the
-
Import the
Kendo.Mvc.UInamespace in~/Views/_ViewImports.cshtmlthrough@using Kendo.Mvc.UI. If you intend to use the Telerik UI ASP.NET Core Tag Helpers, add them with@addTagHelper *, Kendo.Mvc.C#@using MyTelerikProject @using MyTelerikProject.Models @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Kendo.Mvc @using Kendo.Mvc.UI -
Include the required client-side resources.
5.1 Go to
~\Views\Shared\_Layout.cshtmland add the theme of your choice to the<head>of the document. Since the Microsoft project uses Bootstrap, you can use the Telerik UI Bootstrap theme to match it:HTML<head> ... <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" /> <link rel="stylesheet" href="~/css/site.css" /> @* Add the Kendo Bootstrap theme: *@ <link rel="stylesheet" href="https://kendo.cdn.telerik.com/themes/12.2.3/bootstrap/bootstrap-main.css" /> ... </head>5.2 The ASP.NET Core Web App template template comes with a jQuery script reference at the end of
_Layout.cshtmlfile. Find thejquery.min.jsscript line in the<body>of the document and move it to the<head>. Alterantively, use thejQueryscript hosted on the jQuery CDN.HTML<head> ... <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" /> <link rel="stylesheet" href="~/css/site.css" /> <link rel="stylesheet" href="https://kendo.cdn.telerik.com/themes/12.2.3/bootstrap/bootstrap-main.css" /> <script src="~/lib/jquery/dist/jquery.js"></script> @* Add the jQuery script from the jQuery CDN: *@ <!--<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>--> ... </head>5.3 Add the required Kendo UI script files in the
<head>tag after thejQueryscript reference:HTML<head> ... <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" /> <link rel="stylesheet" href="~/css/site.css" /> <link rel="stylesheet" href="https://kendo.cdn.telerik.com/themes/12.2.3/bootstrap/bootstrap-main.css" /> <script src="~/lib/jquery/dist/jquery.js"></script> @* Add the jQuery script from the jQuery CDN: *@ <!--<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>--> <script src="https://kendo.cdn.telerik.com/2025.4.1111/js/kendo.all.min.js"></script> <script src="https://kendo.cdn.telerik.com/2025.4.1111/js/kendo.aspnetmvc.min.js"></script> </head>
- The
kendo.all.min.jsandkendo.aspnetmvc.min.jsscripts must be loaded after thejquery.min.jsscript.jQuerymust be loaded only once. Ensure there are no duplicate references elsewhere in the_Layout.- Starting with version 2023.3.1010, the Kendo UI bundles do not include the jQuery library in their
jsdirectories and you can use any available jQuery source you prefer (https://jquery.com/download/).
If you prefer to include the client-side resources from a local source instead of CDNs, refer to the Local Client-Side Resources article.
Adding a Telerik UI Component
The default casing for JSON strings in ASP.NET Core is camelCase. The Telerik UI components that are data-bound depend on PascalCase formatted response from the server. If the JSON serialization isn't configured properly, the UI components will display wrong data. To find out how to configure the application to return the data in Pascal-case, refer to the JSON Serialization article.
-
Define the Telerik UI DatePicker component by adding the snippet from the following example to
~/Views/Home/Index.cshtml.Razor<div class="text-center"> <h2>Kendo UI DatePicker</h2> @(Html.Kendo().DatePicker() .Name("my-picker") ) </div> -
Navigate to the project folder by using the terminal (cmd) and run the project through the
dotnet runcommand. The Index page will display a DatePicker.
Next Steps
- Use data-bound components
- Download and install UI for ASP.NET Core (overview)
- Create your own custom bundles
- How to update UI for ASP.NET Core to a new version
- Switch from Trial to Commercial License