RadzenBody/RadzenSidebar with AuthorizeView and how to toggle

Hi. So I have a login page in which I do NOT want to show my RadzenSideBar navigation, so i have wrapped it in a AuthorizeView like so

<AuthorizeView>
     <Authorized>
     <RadzenSidebar @ref="@sidebar0" >
         <ChildContent>
             <div class="sidebar colZ-1">
                 <NavMenu />
             </div>
         </ChildContent>
     </RadzenSidebar>
     </Authorized>
     </AuthorizeView>

So I now want my RadzenBody control to take the full screen, but I cant seem to figure out when or how to get it to toggle and then show the menu and toggle back after auth is complete.

Any help would be great!

Just in case anyone has this issue, here is the code I used to solve it. I guess when a control is in a AuthorizedView it won't get rendered:

    protected override void OnAfterRender(bool firstRender)
    {
        if(firstRender)
        {
            body0.Toggle();
        }
        base.OnAfterRender(firstRender);
    }
2 Likes

I know it's an old topic, but I have a situation that I think is similar. On my page I defined the atribute AuthorizeRoles and defined the types of user (user, premium user, administrator and attendant) and I have some elements within an AuthorizedView that only the administrator and attendant can access. When accessing the page as a user it works normally, but as an administrator the page does not load anything from AuthorizedView onwards! Just tell me what this body0 variable is, it is instantiating the page, is that it?

It is a reference to the RadzenBody component. Here is our example.