locked
Razor Pages or Blazor Server side RRS feed

  • Question

  • User-639631676 posted

    Hello

    I notice we now have Razor Pages and Blazor Server Side along with Blazor Client Side

    I am only interested in Server Side so have two choices Razor Pages or Blazor Server Side

    Does Blazor server side come with out of the box all ready to use signal r, or does that need to be set up ?

    Am I right in saying that Razor Pages can also use signal r when added ?

    Razor Pages has scaffolding, does Blazor Server Side also have scaffolding ?

    Answers to these questions will help me decide which to learn

    Thanks

    Gary

    Thursday, July 9, 2020 6:28 PM

All replies

  • User475983607 posted

    This information is openly available in the official docs.

    SnookerTable

    Does Blazor server side come with out of the box all ready to use signal r, or does that need to be set up ?

    The latest SDK comes with Razor Page and Blazor templates.  The Blazor template wires up SignalR. 

    https://dotnet.microsoft.com/learn/aspnet/blazor-tutorial/create

    dotnet new blazorserver -o BlazorApp --no-https

    SnookerTable

    Am I right in saying that Razor Pages can also use signal r when added ?

    Yes; https://docs.microsoft.com/en-us/aspnet/core/tutorials/signalr?view=aspnetcore-3.1&tabs=visual-studio

    Razor Pages has scaffolding, does Blazor Server Side also have scaffolding ?

    Yes.  You should set aside time to play with the two projects. and make a proof of concept  This is a much better approach than a forum post so you are fully aware of what to expect

    Thursday, July 9, 2020 6:44 PM
  • User-474980206 posted

    they are totally different.

    Razor pages build html that is sent to a browser on request. It is stateless, and can be indexed by search engines. You can add javascript and signal/r to your razor pages. 

    Blazor server is a client server architecture. the client is javascript library that uses signal/r to talk to the blazor server. This is a persistent connection, with state maintained at both ends. If the connection is lost, the blazor app ends. Due to persistent connections, scaling may be an issue.

    see:

    https://docs.microsoft.com/en-us/aspnet/core/blazor/hosting-models?view=aspnetcore-3.1#blazor-server

    I would say you would pick blazor if you wanted to create an SPA, and write it in C#. If you wanted a more traditional website with links, then razor pages.

    Thursday, July 9, 2020 7:02 PM