How can I programmatically determine the Blazor render mode

David Thielen 2,306 Reputation points
2024-03-17T17:45:46.4966667+00:00

Hi all;

How can I get the render mode Blazor is using for my component. There is this suggestion but that won't work for Auto as it could be either. I want to verify I've configured everything properly so my app is tunning in InteractiveServer.

thanks - dave

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,414 questions
{count} votes

Accepted answer
  1. JasonPan - MSFT 4,386 Reputation points Microsoft Vendor
    2024-03-18T02:59:28.8133333+00:00

    Hello David Thielen,

    There is no direct way ( API ) to achieve this requirement. And I found a github issue about want to Add an API to tell you the current render mode. It seems that there are plans to add this feature in the future.

    You also can find the workaround about checking the IsPrerendering property in your component.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards

    Jason

    0 comments No comments

0 additional answers

Sort by: Most helpful