0

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://learn.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.

7
  • 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. Commented Oct 27, 2020 at 10:07
  • @BrandoZhang Thank you. I think it is just what I need. Commented Oct 27, 2020 at 11:39
  • 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. Commented Oct 27, 2020 at 12:11
  • @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. Commented Oct 27, 2020 at 18:50
  • @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. Commented Oct 28, 2020 at 2:25

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.