Skip to content

Commit 7888c4a

Browse files
docs(common): blazor in asp.net KB
1 parent a1fd47c commit 7888c4a

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: Telerik Blazor in ASP.NET Web Application
3+
description: Use Telerik Blazor components in ASP.NET Web Application
4+
type: how-to
5+
page_title: Telerik Blazor in ASP.NET Web Application
6+
slug: > telerik-blazor-in-asp-net-app
7+
8+
position:
9+
tags:
10+
ticketid: 1422791
11+
res_type: kb
12+
---
13+
14+
15+
## Description
16+
You may have an ASP.NET Core 3 web application and you may want to start using Blazor components in it so you can modernize it, and even to eventually migrate it to Blazor.
17+
18+
## Solution
19+
You can use an ASP.NET Core 3 web application to render Blazor components. Here is a list of the requirements and things to keep in mind (as sample project is available at the end):
20+
21+
* You must first add Blazor to the project. This includes the client-side assets, the service, and the SignalR hub. In the sample project, they are added to the layout so that all pages can use them. Make sure you don't add them twice on a certain page.
22+
* You must then [add the Telerik components as usual]({%slug getting-started/what-you-need%}). The `TelerikRootComponent` must be added around the contents of every Blazor component, because there is no other way to render it.
23+
* Use Blazor components like partial views - through `Html.RenderComponentAsync`. Pass their Parameters as fields in an anomymous model object you can pass to the method.
24+
* If you are already using Kendo widgets in such a project, make sure to only use the [Telerik UI for Blazor Themes]({%slug general-information/themes%}). They match the [SASS-based themes from Kendo](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes) and you must only have one theme referenced.
25+
* Try using versions of Kendo UI and UI for Blazor that are close together, so that there are as little differences in their theming as possible. The latest versions are advisable.
26+
27+
A sample project with comments is available here: [blazor-in-asp-net.zip](blazor-in-asp-net.zip).
28+
29+
The project references a commercial version of UI for Blazor. If you only have a trial license, replace the reference to the NuGet package and to the JS Interop file [accordingly]({%slug getting-started/what-you-need%}).
30+
31+
>note The sample project was made at the time of UI for Blazor 1.4.1 and .NET Core 3 Preview 7 - therefore, as the Blazor framework evolves, changes may be required.
32+
1010 KB
Binary file not shown.

knowledge-base/jquery-kendo-in-blazor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ While migrating an application to Blazor, you may not have time to implement all
1717
We advise that you consider using only native Blazor components like the UI for Blazor suite, because this is how the framework is designed to operate. Widgets based on jQuery (such as Kendo UI) rely on direct DOM manipulation and this is something Blazor controls instead of you.
1818

1919
## Solution
20-
One approach may be to [use Blazor components in an ASP.NET Core 3 application](https://www.telerik.com/blogs/integrating-blazor-components-with-asp-net-core-views). Whether this is feasible depends on your project path and if/how you are migrating from an older project.
20+
One approach may be to [use Blazor components in an ASP.NET Core 3 application](https://www.telerik.com/blogs/integrating-blazor-components-with-asp-net-core-views). Whether this is feasible depends on your project path and if/how you are migrating from an older project. You can read more details about this in the [Telerik Blazor in ASP.NET Web Application]({%slug telerik-blazor-in-asp-net-app%}) article.
2121

2222
Should you decide to use jQuery widgets from the Kendo UI suite, here are the things to keep in mind:
2323

0 commit comments

Comments
 (0)