Warm tip: This article is reproduced from serverfault.com, please click

Blazor load JavaScript just in Component that require <script>

发布于 2020-11-29 22:29:40

I want to implement an external (Google Maps) and it is only required in two Pages of the Blazor Server Side Application.

So my question is if it is possible to just load the in this Pages and not directly in _Hosts File. If yes how can I achieve this?

Questioner
baer999
Viewed
0
enet 2020-11-30 16:29:44

Yes, it is possible in .Net 5.0 Read here

See this for an introduction and code samples

See this answer