Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4303

.NET Blazor prerendering disabled, link still called twice

$
0
0

I have a .NET 9 Blazor server side application. In the layout file I have a <NavLink> that points to my login page. The login page is not a razor page, but a mapped Controller ([ApiController] with [Route]).

If I disable prerendering on a page, using @rendermode @(new InteractiveServerRenderMode(prerender:false)), I can see that i.e. OnInitialized() is called only once when accessing that page.

But when I click the login link from that page the controller is called twice (I can also see two request in devtools in the browser). I assume this is because of prerendering, but this has been disabled, so something else must be at work here.

Why is a link to my controller called twice?


Viewing all articles
Browse latest Browse all 4303

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>