• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
灬伊天?
博客园    首页    新随笔    联系   管理    订阅  订阅

002-MVC布局页

~/Views/Shared/_LayoutPage1.cshtml

 1 <!DOCTYPE html>
 2 <html>
 3 <head>
 4     <meta name="viewport" content="width=device-width" />
 5     <title>@ViewBag.Title</title>
 6     @RenderSection("head", true)
 7 </head>
 8 <body>
 9     <div>
10         布局页面
11         @RenderBody()
12     </div>
13 </body>
14 </html>

~/Views/AjaxDemo/Show.cshtml

 1 @{
 2     ViewBag.Title = "Show";
 3     Layout = "~/Views/Shared/_LayoutPage1.cshtml";
 4 }
 5 @section head{
 6     <script type="text/javascript">
 7 
 8     </script>
 9 }
10 @using MvcApplication1.Models
11 @model MvcApplication1.Models.UserInfo
12 <h2>Show</h2>
13 <table>
14     <tr><td>Hello,World</td></tr>
15 </table>

 

posted @ 2017-03-25 15:00  灬伊天☂  阅读(91)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3