My layout name is = _DefaultLayout
.
Controller:
_ViewStart:
Index.cshtml:
The CSS is not loaded in this page, but on another page it is loaded.
Please help my to fix this problem
Thanks
Seem like typo problem. The suffix for layout code is predefined. Therefore, change _DefaultLayout.csshtml
to _DefaultLayout.cshtml
.
Then in the _ViewStart.cshtml you can write:
@{
Layout = "~/Views/Shared/_DefaultLayout.cshtml";
}
And check that Build Action
property of the _DefaultLayout.cshtml
file is set to Content
.
For additional information see: Layout in ASP.NET Core