© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
10 replies
SpReeD

✅ Blazor and Javascript loading

So, I have a main page and a separate adminpage. On navigating to the admin site it changes the layout to
AdminLayout.razor
AdminLayout.razor
which inherits from
@inherits LayoutComponentBase
@inherits LayoutComponentBase
. So far, so good, the adminpage inlcudes
@layout AdminLayout
@layout AdminLayout
and everything is displayed correctly.

The AdminLayout also has several JS includes at the end of
body
body
.
It seems that after first navigation those scripts aren't loaded, the behaviour is as followed:
- Navigate to admin page
- Click on a
<a href="#">
<a href="#">
that should expand a collapsed div, but it doesn't
- Reload/Refresh the page after it's initial load and it works as expected

Switching the rendermode to Server and Server without prerender haven't helped here.
Navigating to the adminpage via
NavigationManager
NavigationManager
, could this be an issue?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Using JavaScript with Blazor
C#CC# / help
2y ago
❔ Use Javascript in Blazor Server App
C#CC# / help
3y ago
Blazor CSS not loading properly
C#CC# / help
5mo ago
❔ Blazor JSInterop declare component-scoped javascript variables
C#CC# / help
4y ago