Empty Layout Page

I have added some logic to the MainLayout to see if the authenticated user has permission (DB lookup) to use the application. If the answer is no I want it to redirect to an emply layout page saying unauthorized.

How can I accomplish this? In Radzen I was able to create another layout without the menu etc to accomplish what I need.

My "check" is in OnInitializedAsync of the main layout, I've not found a way to create a page that doesn't include the "MainLayout" I'm sure this is something simple I'm overlooking.

Ideas?

You can create a copy of the MainLayout and remove what's not needed. Creating layouts is not yet supported from the UI.

Thank you worked like a charm. I have to say I'm really liking Radzen Studio, I'm finding myself using Radzen less and less.

Hello Kest,

Could you please provide details what you have done? I have a need to be able to load a page without authorization, but have not been able to stop the blink of the MainLayout loading and redirecting. Currently testing 1 of the 5 different ways people suggest even though all the solutions say they get the blink.

I copied the MainLayout.razor and the MainLayout.razor.cs to a new layout called "Empty Layout"

image

Removed the navigation etc.

On my "Unauthorized.razor" I simply added @layout EmptyLayout
image

2 Likes

Thank you for the detail