Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
既に多数のビューを作成している場合、それらのレイアウト ページを変更する方法はありますか?
ファイル _ViewStart.cshtml で、アプリケーション全体の既定のレイアウト ページを変更できます。デフォルトでは、次のコードがあります。
@{ Layout = "~/Views/Shared/_Layout.cshtml"; }
これは、ビューのいずれかが使用するレイアウトを明示的に指定していない場合、このレイアウトを使用することを指定します。
または、使用するレイアウトを明示的に示すコードを (上記のように) ビューに追加することもできます。