

The file fixes up the events for the razor (Blazor) file, among other things. It seems that the _framework line needs to be placed in the cshtml page (see Snippet 1) which contains the RenderComponentAsync call. Although, I think that it might still be in the wrong place. Understand that the _framework line was throwing the error. However, I moved it to the _Host.cshtml file as below (Snippet 2).

The tag of the _Layout file contained the _framework script tag below. I found some time and figured out the following. I do not think it caused a problem so I am leaving it for a while and shall look into Some research suggests that HTML is being parsed where JSON is expected. This seems to have crept in since I have converted the project in the way suggested by Mikail. The blog is pretty easy to follow and the program compiles all right, and a small Blazor component runs and is inserted correctly in a page-ipso facto the conversion worked. The project I am creating uses Telerik UI for Blazor so there is a small amount extra to place in the _Imports.razor file. There might be a more up-to-date blog, however, this works OK (apart from a Developer Console error that has crept in). I used a 2019 blog post by Mikail Koskinen which can be found here to Slightly odd in my opinion-however, I expect the reason is in there somewhere. razor and Razor files have the extension. Something worth noting at this point: Blazor files have the extension. After all, I did not want to explore that avenue, so I went with the hybrid model where the BlazorĬomponent can only be embedded inside a Razor. A #core project needs to be base type Razor (.cshtml) or Blazor (.razor). I am attempting to show you a timeline and a workflow within my learning pattern. cshtml partials to work inside Blazor (.razor) pages. Perhaps with considered work I could surmount this task. Using Blazor “whole” pages is impractical because the “scaffolding” surrounding each page gives the program a consistent look and feel. This allows Blazor “components” to be included in. I have incorporated the hybrid approach into the main Buku Project that I am working on.

since writing the previous paragraph, I have changed my mind. I have not researched other people’s opinions at his stage.Ī week later. Mainly because I do not think it is a good idea to have a hybrid project using both types of pages. We do need to create two projects and transfer the relevant pages from My current level of research tends to suggest it is not possible without a lot more effort to convert an existing ASP.NET Core Razor project to a Blazor view within the same project. I also understand that Blazor has further implementation usages for the server side although we are not looking at all usages.
#Js screenx versus pagex code#
I suppose it is nice to code in one language and let the compiler do the rest, i.e., frontend rendering.
#Js screenx versus pagex how to#
One question arises as to whether it is important to learn a new language when I already know how to program JavaScript (in my own way :) ).

Further, I am interested in whether the Blazor commands render JavaScript for the browser to interpret. Let us see how I learn from my research and achieve more knowledge and understanding about this relatively new addition to the ASP.NET family of languages. Almost instead of Razor translating C# into HTML CSS and JavaScript pre-rendering on the client. However, if you are interested in learning about how one developer explores a newer technology and what is possible with it,īefore I start, and as I understand it, Blazor C# can be used on the frontend to operate instead of JavaScript, in one of its capacities. cshtml page-which, in the end, is not an approach I would recommend for reasons of lack of elegance. The approach I ended up using is a hybrid with Blazor components (not entire Views) embedded What follows is a demonstration of my explorations of how ASP.NET Core in C#, Razor and Blazor work together, including some pivots in my research when I hit a wall. I am rather new to Blazor, though not to Razor, and writing this piece has been instrumental in becoming more experienced. When I began writing this blog post, I was interested in discovering how easy it is to convert a Razor cshtml to a Blazor razor file. See how one developer explores a newer technology and what is possible with it-in this case, how ASP.NET Core in C#, Razor and Blazor work together, including some pivots after hitting a wall.
