BEST
DEALS
OF THE
YEAR!
SAVE UP TO $3,000
LAST DAY 1 DEC
00 Days
00 Hrs
00 Min
00 Sec
Open Closed

We want know how to hide the top menu from one .razor page based on the customize condition #6325


User avatar
0
kingshuk created
  • ABP Framework version: v7.2.1
  • UI Type: Blazor WASM
  • Database System: EF Core (MSSQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes Please review the image, now we want to hide the top menu from one .razor page based on the customize condition how to do that. Please give us the proper steps so that we can follow and do that by ourselves.

1 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    You can try this:

    [Inject]
    protected IJSRuntime JsRuntime {get;set;} = default!;
    
    
    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        if(firstRender)
        {
            await JsRuntime.InvokeVoidAsync("eval", "document.getElementsByClassName('lpx-header-bottom')[0].hidden = true");
        }
        await base.OnAfterRenderAsync(firstRender);
    }
    
    protected override void Dispose(bool disposing)
    {
        JsRuntime.InvokeVoidAsync("eval", "document.getElementsByClassName('lpx-header-bottom')[0].hidden = false");
        base.Dispose(disposing);
    }
        
    
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on November 20, 2025, 09:12
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.