I've been reading about Razor Pages and the idea of being liberated from JavaScript is very compelling. From what I've gathered, while a Blazor client uses the same libraries as the rest of ASP.NET Core, it is a seperate ASP.NET Core web platform.
Is possible to add a Blazor page within an ASP.NET Core MVC application? Why wasn't it developed as an addition to the existing ASP.NET Core platform, instead of a seperate platform?
Blazor applications are component-based. Blazor components can be used in existing ASP.NET MVC applications.
Blazor Server provides support for hosting Razor components on the server in an ASP.NET Core app. UI updates are handled over a SignalR connection. The runtime stays on the server and handles: Executing the app's C# code.
Blazor can make web development easy and more productive by providing full-stack web development using . NET. It runs in all browsers in real . NET runtime and has full .
No, you can't "run Blazor client page within ASP.NET MVC Core page."
The concept of page in Blazor does not exist, unless you mean a Document Page displayed in the browser.
Blazor is focused around the concept of Components: Blazor Component Model.
Yes, you can embed Blazor Components in an MVC app or Razor Pages App.
This is how to do that:
Note: This is not Blazor... In Blazor we've got no Html Helpers
<app>@(await Html.RenderStaticComponentAsync<App>())</app>
Below is a link to the page where it is used: https://github.com/danroth27/ClientSideBlazorWithPrerendering/blob/master/ClientSideBlazorWithPrerendering.Server/Pages/_Host.cshtml
Note that _Host.cshtml is not a Blazor Component. It is, again, a Razor Pages page.
Note that in the sample a whole Blazor app is actually rendered, but of course you can use a normal simple Blazor component (one or more, unrelated components, or related ones, that is, parent component with child components). The principal is the same.
Hope this helps...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With