首页 > Web开发 > 详细

002-MVC布局页

时间:2017-03-25 15:19:11      阅读:113      评论:0      收藏:0      [点我收藏+]

~/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>

 

002-MVC布局页

原文:http://www.cnblogs.com/ninghongkun/p/6617185.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!