MVC 整体布局搭建
1.在 Views —》Shared—》新建布局页面(_Layout.cshtml)
a.MVC 布局页面
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>@ViewBag.Title</title> </head> <body> <div> @RenderBody() </div> </body> </html>
布局页面带<html></html>标签
1.在 Views —》新建带有布局页面(_ViewStart.cshtml)
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}