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

Telerik UI for ASP.NET Core Template Basic Usage

Loading Demo...
  • EXAMPLE
  • VIEW SOURCE
  • Edit in Telerik REPL
HtmlHelper
TagHelper
Files:
index.cshtml
IndexController.cs
Index_TagHelper.cshtml

Also available for:

HTML HELPER API

Description

The Telerik UI for ASP.NET Core Template component allows you to seamlessly nest multiple Telerik UI for ASP.NET Core components within other Telerik UI for ASP.NET Core components. You can incorporate it into components like Data Grid, ListView, TreeList, which often require complex layout templates, for example, column templates, custom editors, items layout, etc. On top of that, when using the Template component, it creates CSP-compatible templates.

The component supports HTML and Tag Helper mode. The HtmlHelper Template component provides the following options:

  • AddComponent()—The method accepts any Telerik UI for ASP.NET Core HtmlHelper component declaration.
  • AddHtml()—The method accepts HTML code.

When using the Tag Helper approach, you can integrate the desired UI component and HTML code within the <{parentTagName}-{templateOption}> tag.

This specific example demonstrates how to utilize the Template component to customize the items of the ListView by integrating Cards, Ratings, and Buttons.

Additional Apps

This Template example is part of unique collection of hundreds of ASP.NET Core demos, with which you can see all Telerik ASP.NET Core components and their features in action. View the source code of the demos from the library or directly adapt, and edit them and their theme appearance in Telerik REPL for ASP.NET Core or ThemeBuilder.

Support & Learning Resources

Additional Resources