How to render a blazor component in an iframe

865 Views Asked by At

Is it possible to render a Blazor component in an iframe?

The component which I want to render resides into another project. The idea is to exclude that other project if not required for the build. But since the component which I am using is from that other project, if I exclude that project, it will give reference error.

I came accross iframe while doing RnD on this. In iframe we specify src which is the page we want to render. In this case, how do I specify a blazor component? I tried specifying Component.razor, http://localhost:1234/Component.razor etc. but the frame appears blank as shown below. enter image description here

0

There are 0 best solutions below