Last post Dec 28, 2020 07:44 AM by YihuiSun
Dec 27, 2020 08:41 PM|roguenidb|LINK
I am using .net 5 for a asp.net web site and I want to have a my themes in and orginized way.
I want to have
Theme\ThemeName\_Layout.cshtml this would be even used for say if the user went to the Home Controller
But at present no matter what i am doing its looking for it here
Is thee a way to have a custom view location by the way I am using razor pages cshtml.
My startup.cs route data is
Dec 28, 2020 07:44 AM|YihuiSun|LINK
I am using razor pages
Do you want to specify the Layout view? Razor views have
a Layout property. Individual views specify a layout by setting this property.
If your project is a Razor Pages application, you only need to add this code to the Index page:
Layout = "/Pages/Shared/Theme/ThemeName/_Layout.cshtml";
But according to the Startup.cs code you provided, your project looks like an
MVC application,you need to add this code to the Index view:
Layout = "/Views/Shared/Theme/ThemeName/_Layout.cshtml";