I want to exclude _layout for specific admin dashboard View. The only way I’m aware is with JS to hide those divs. Is there any other way?
I want to exclude _layout for specific admin dashboard View. The only way I’m aware is with JS to hide those divs. Is there any other way?
2
Answers
In the razor page for which you don’t want to use a layout, you can do:
If you want to exclude Layout from view temporarily, you can return view from a controller action using this code
When you return a partial view, it will show only a view, no a layout
If your wont to exclude a layout permanenly for some views, you can use this code inside of the view
but don’t forget that a Layout usually contains the most of Javascript and css libraries. So it is better to create a special layout for some views.
or you can use ViewStart page