0
votes

I made a blazor server-side project for submitting the form.

In spite of there is a tutorial of Microsoft about how to embed it in asp.net core(https://docs.microsoft.com/en-us/aspnet/core/blazor/components/integrate-components?view=aspnetcore-3.1). However, I am about to embed it not only in one website but also in some other. So this way is so troublesome.

There is another way by using Iframe. Whereas Iframe does not support CSS vh units well and it has some other limited(such as samesite attribute/cross-origin).

Is there any way to solve this? Thank you.

1
I suggest you could consider build it as an Templated components. And then you could use this template in each project. Details, you could refer to this article. - Brando Zhang
@BrandoZhang Thank you. I think it is just what I need. - Melon NG
If you feel my comment has helped you, I will generate a reply. Could you please mark it as answer? So that other folks who faces the same issue could find the answer more easily. - Brando Zhang
@Melon NG, I'm not sure I understand what issue you're facing... Is your Razor components 'App' embedded in Asp.Net Core project, say, Razor Pages App, functions perfectly well ? And now you desire to define it in a single location and use it in multiple projects ? Or you are facing two issue:1. How to implement it in Asp.Net Core 2. Make it work from a single location. Please be clear what you want and what you need. Show all your code. Note: Templated components has nothing to do with it. If anything, and I still have to be clear about your issues, what you need is a Razor class library. - enet
@enet The feature is used to submitting visitor's names and phones on the website. I used AJAX to achieve this before and I don't want to use it again. And also, I know less about VUE and any other front-end framework. So I have to use Blazor to achieve this. - Melon NG

1 Answers

1
votes

I suggest you could consider build it as an Templated components.

You could create a component library. And then you could use this template in each project.

Details, you could refer to this article.