You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _contentTemplates/common/js-interop-file.md
+7-1
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
#add-blazor-js-file-to-component
2
-
add the `telerik-blazor.js` file to your main index file. For a client-side Blazor app, it is `wwwroot/index.html`, and for a server-side Blazor app it is `~/Pages/Index.cshtml`. For example:
2
+
Add the `telerik-blazor.js` file to your main index file. For a client-side Blazor app, it is `wwwroot/index.html`, and for a server-side Blazor app it is `~/Pages/Index.cshtml`.
This static asset works for server-side and ASP.NET Core hosted client-side project types. If you use a purely client-side model, you must reference the script from our CDN, because of [an issue in the framework](https://github.com/aspnet/AspNetCore/issues/10986): `https://kendo.cdn.telerik.com/blazor/1.2.0/telerik-blazor.min.js`. Make sure that the version in the URL matches the version of the Telerik Blazor package used in your project.
Copy file name to clipboardExpand all lines: getting-started/what-you-need.md
+13-6
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ position: 3
11
11
12
12
# What You Need to Use the Telerik Blazor Components
13
13
14
-
This article explains the packages you need to use the Telerik UI for Blazor components, and how to get them.
14
+
This article explains the packages you need to use the Telerik UI for Blazor components, how to get them, and how to configure your project to include the Telerik Blazor components.
15
15
16
16
To use the Telerik UI for Blazor, you need:
17
17
@@ -52,15 +52,13 @@ To have the Telerik Blazor components look and behave as expected in the browser
* Our JS Interop file. It provides features that cannot be implemented with native Blazor. @[template](/_contentTemplates/common/js-interop-file.md#add-blazor-js-file-to-component)
58
56
59
-
For a server-side Blazor scenario, add it to the `~/Pages/_Host.razor`file.
To have the framework recognize the Telerik Components, you must register them in the `Startup.cs` file of your Blazor project (if you are using [client-side Blazor](), this is the client web application's file):
61
+
To have the framework recognize the Telerik Components, you must register them in the `Startup.cs` file of your Blazor project (if you are using client-side Blazor, this is the Client web application's file):
64
62
65
63
````Startup.cs
66
64
namespaceMyBlazorAppName
@@ -78,9 +76,18 @@ namespace MyBlazorAppName
78
76
}
79
77
````
80
78
79
+
### Client-side Project Considerations
80
+
81
81
If you are using a **client-side Blazor** project,
To enable the use of static assets for the JS Interop file, you must be using an ASP.NET Core hosted project and add the following line to your Client project `Startup.cs` file:
0 commit comments