Razor Component does not render in Asp.net core MVC 6 on host

410 Views Asked by At

Razor Component does not render for security layer of Cloudflare

enter image description here

2

There are 2 best solutions below

0
Saman Bahrekazemi On BEST ANSWER

using minify setting in cloudflare cause this problem.

0
Chen On

Try to use:

@(await Html.RenderComponentAsync<SliderComponent>(RenderMode.ServerPrerendered))

Please check this link to see the difference: RenderMode Enum.

If you must use RenderMode.Server, you can try the way of referencing blazor.server.js: Blazor render-mode="Server" for displaying the component not working.