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

'HttpNavigationManager' not initialized when rendering static HTML

$
0
0

I'm trying to generate HTML to a string from a Razor component. I use the following code to do that:

var html = await _htmlRenderer.Dispatcher.InvokeAsync(async () =>        {            var pv = ParameterView.FromDictionary(parameters);            var output = await _htmlRenderer.RenderComponentAsync<TComponent>(pv);            return output.ToHtmlString();        });

It worked well, until I included a child component in the Razor component and try to render it. I got the following error:

'HttpNavigationManager' has not been initialized

I don't use any navigation logic in the parent, nor in the child component. How can it be fixed?


Viewing all articles
Browse latest Browse all 4840

Trending Articles



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