4

I'm building a solution with blazor server app, and i need to create an area like MVC application. It's possible create solution in blazor using areas?

Anyone have information or something to use for learn about it?

  • Chris Sainty discusses Blazor App organization in his great book, Blazor In Action. See the 18:30 mark in this video: https://www.youtube.com/watch?v=k8sIIGpA3XI – Steve Greene Sep 07 '21 at 20:12

1 Answers1

1

When you want the Areas for your Blazor pages (razor components) then: No, but you can easily use folders to achieve the same.

When you want Areas to hold razor pages (or MVC views) then create a new (scratch) Blazor server project and select Authentication=Individual accounts. That template has everything you need.

H H
  • 263,252
  • 30
  • 330
  • 514
  • Thanks for the information. I want to "separate" the guest section, from the admin section. I Imagine, than i can have the same results using folders and roles (Microsoft Identity) – Steven Gazo M. Sep 07 '21 at 20:05
  • I don't think you can have an "_imports.razor" per folder, so authorization will take some care. – H H Sep 07 '21 at 20:51
  • Ok, i understand, thanks for the information and your help (this is one of my first projects [ in blazor and web]) – Steven Gazo M. Sep 07 '21 at 23:29
  • @HenkHolterman You definately can have an _Imports.razor per folder. https://learn.microsoft.com/en-us/aspnet/core/blazor/components/layouts?view=aspnetcore-5.0#apply-a-layout-to-a-folder-of-components-1 – Brian Parker Sep 08 '21 at 05:31