How can I programmatically determine the Blazor render mode

David Thielen 3,211 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

Developer technologies .NET Blazor
{count} votes

Accepted answer
  1. Anonymous
    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.