I'm working in a new ASP.NET Core 3.1 With Razor Pages application (as opposed to the pure Blazor app template default) and I want to use Syncfusion Blazor components in it but I'm having trouble getting it to work. I've followed the instructions on numerous sites about how to enable Blazor components in an MVC based application that uses Razor pages (changing the Configure and ConfigureServices methods in startup.cs, adding the endpoint, including the .js for Blazor, etc.).
If I write a component myself and use that it seems to work just fine so it appears that Blazor is indeed working as expected. But I tried using Syncfusion's Blazor library and it just refuses to work. I've tried things in the Razor page like:
@(await Html.RenderComponentAsync<Syncfusion.EJ2.Blazor.Calendars.EjsDateTimePicker>(RenderMode.ServerPrerendered))
which works just fine for my manually created Blazor component but not the third party EjsDateTimePicker component. I've also made sure to include the @using references that are needed and VS finds everything, as well as including the JS references to ej2.min.js and ej2.interop.min.js in my layout file.
I also tried including the third party component into my manually created component since Blazor allows for that and VS recognizes the component/tag but still refuses to render it. In that case, when I call my own component like:
<CustomRazorTest>@(await Html.RenderComponentAsync<TestProj.Components.Pages.CustomRazorTest>(RenderMode.ServerPrerendered))CustomRazorTest>
it renders everything except the Syncfusion
EjsDateTimePickercomponent. I also tried the different rendering methods just in case that might fix it. But nothing seems to work.
@using Syncfusion.EJ2.Blazor
@using Syncfusion.EJ2.Blazor.Calendars
|
|
<EjsDatePicker Placeholder='Choose a Date'></EjsDatePicker>
|
Visual Studio Version |
Version 16.4.0 Preview 6.0 |
Syncfusion Blazor Nuget version |
17.3.0.29-beta |
Syncfusion Asp.Net Core Nuget version |
17.3.0.31 |
.NET Core version |
.NET Core 3.1 |
.NET Core SDK version |
.NET Core 3.1 Preview 3 |