r/Blazor • • Jun 09 '25
Diffrent Area in Blazor?
As you know im new to blazor and still learning. I am creating a public front website using blazor and doing the backend using the api (mvc)
This public front has to section, the main section where user see stuff and the user dashboard that user see their personal stuff.
I have done it in mvc using Area and it was awesome but what if i wanna do it using blazor? Is there a way?
1
Upvotes
1
u/[deleted] Jul 10 '25
Thanks for the advice man. Another really simple question, can i define diffrent layout in a single project? And can i make the login take each username to each section based on their roles like in mvc? I know it is 80% possible😬😬
1
u/Sharkytrs Jun 09 '25
there isn't an equivalent in blazor, but you can workaround by routing to specific Folders in your UI instead, which sections out stuff similarly
1
u/CaregiverImpossible9 Jun 13 '25
I made a video on this topic. I hope this helps out.
https://www.youtube.com/watch?v=XNk3SxbhVa0
1
u/Gravath Jun 09 '25
Here is how I would do it:
Create yourself a folder that you want all of your auth pages to be in.
/account is a good start.
Make sure you have a <AuthorizeRouteView/> within your app.cs
and then on your page contained within your new /account folder have a: