Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to remove MainLayout from my Sub-Page?

How to remove MainLayout from my Sub-Page ?
when I create a subpage in my project, it create with the MainLayout page, how to remove this automate call from my sub-page ? note that I’m using blazor and .net 5 !

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You can create a AnnonymousLayout razor component like this

AnnonymousLayout.razor

@inherits LayoutComponentBase

<div style="width: 100%; height: 100%;">
    @Body
</div>

And you can use it in a page where you do not want main layout, like this

@page "/yourpage"
@layout AnnonymousLayout
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading