Closed FreddyFox1 closed 2 days ago
Solution from README doesnt work for me. I got this error message. Can help me some one ?
Code of my BasicLayout:
<AuthorizeView> <Authorized> <AntDesign.ProLayout.BasicLayout Logo="@("assets/logo.svg")" MenuData="_menuData" Collapsed="@false"> <HeaderContentRender> <Space Size="@("24")"> <SpaceItem> <Icon Class="action" Type="reload" Theme="outline" OnClick="Reload"/> </SpaceItem> </Space> </HeaderContentRender> <RightContentRender> </RightContentRender> <ChildContent> <ReuseTabs /> </ChildContent> <FooterRender> <FooterView Copyright="2024 Ant Design Blazor"></FooterView> </FooterRender> </AntDesign.ProLayout.BasicLayout> <SettingDrawer/> </Authorized> <NotAuthorized> <RedirectToLogin/> </NotAuthorized> </AuthorizeView>
App.razor:
@inject IdentityInfoService Identity; @using Bars.Training.Web.Models @using Bars.Training.Web.Services <CascadingAuthenticationState> <Router AppAssembly="@typeof(Program).Assembly"> <Found Context="routeData"> <CascadingValue Value="routeData"> <AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(BasicLayout)"/> </CascadingValue> </Found> <NotFound> <LayoutView Layout="@typeof(BasicLayout)"> <p>Sorry, there's nothing at this address.</p> </LayoutView> </NotFound> </Router> </CascadingAuthenticationState> @code { [Parameter] public InitialApplicationState InitialState { get; set; } protected override async Task OnInitializedAsync() { Identity.UserName = InitialState.UserName; Identity.IsAuthenticated = InitialState.IsAuthenticated; } }
Solution from README doesnt work for me. I got this error message. Can help me some one ?
Code of my BasicLayout:
App.razor: