站长资源网络编程

ASP.NET MVC Layout如何嵌套

整理:jimmy2026/8/5浏览2
简介直接上代码:模板页Layout.cshtml代码(路径"~/Views/Backstage/MachineMng/Layout.cshtml"):@{ViewBag.Title = "货机管理";}@ViewBag.Titl</div> <div class="news_infos"><div id="MyContent"><p>直接上代码:</p> <p>模板页Layout.cshtml代码(路径"~/Views/Backstage/MachineMng/Layout.cshtml"):<br> </p> <div class="htmlcode"> <pre class="brush:xhtml;"> @{ ViewBag.Title = "货机管理"; } <!DOCTYPE html> <html> <head> <title>@ViewBag.Title</title> <style type="text/css"> body { font-size: 12px; padding: 0; margin: 0; background-color: #666; } .ul-menu { float: left; margin: 0; padding: 0; margin-left: 3px; } .ul-menu li { float: left; list-style: none; margin: 0; padding: 0; width: 45px; height: 25px; line-height: 25px; text-align: center; margin-right: 20px; border: solid 1px #999; cursor: pointer; } </style> <script type="text/javascript" src="/UploadFiles/2021-04-02/jquery-1.8.2.js"> <p>模板页RoadSetLayout.cshtml代码:(路径"~/Views/Backstage/MachineMng/RoadSetLayout.cshtml"):<br> </p> <div class="htmlcode"> <pre class="brush:xhtml;"> @{ ViewBag.Title = "货道设置"; Layout = Url.Content("~/Views/Backstage/MachineMng/Layout.cshtml"); } <!DOCTYPE html> <html> <head> <title>@ViewBag.Title</title> <style type="text/css"> .div-button1 { float: left; width: 120px; height: 35px; border: solid 1px #999; font-size: 18px; line-height: 35px; text-align: center; cursor: pointer; } .div-button2 { float: left; width: 120px; height: 30px; border: solid 1px #999; font-size: 14px; line-height: 30px; text-align: center; cursor: pointer; } .div-arrow { float: left; height: 55px; padding-top: 5px; } .div-arrow2 { float: left; width: 35px; height: 22px; padding-top: 6px; margin-left: 10px; } </style> <script type="text/javascript" src="/UploadFiles/2021-04-02/jquery-1.8.2.js"> <p>Index页面代码(路径"~/Views/Backstage/MachineMng/RoadSet/Index.cshtml"):<br> </p> <div class="htmlcode"> <pre class="brush:xhtml;"> @{ ViewBag.Title = "货道设置"; Layout = Url.Content("~/Views/Backstage/MachineMng/RoadSetLayout.cshtml"); } <!DOCTYPE html> <html> <head> <title>@ViewBag.Title</title> <link type="text/css" href="~/Scripts/jquery-easyui-1.4.1/themes/default/easyui.css" rel="stylesheet" /> <style type="text/css"> body { font-size: 12px; } .div-box { float: left; border: solid 1px #f5f5f5; height: 148px; width: 97px; background-color: #f5f5f5; cursor: default; } .div-box div { float: left; margin-top: 15px; margin-left: 9px; height: 120px; width: 80px; line-height: 120px; font-size: 16px; font-family: 黑体; text-align: center; } .ul-instructions { float: left; width: 200px; padding: 0; margin: 0; margin-left: 10px; margin-top: 10px; margin-bottom: 10px; } .ul-instructions li { float: left; list-style: none; width: 200px; line-height: 25px; font-size: 12px; margin: 0; padding: 3px; } .ul-instructions li div { float: left; } .div-road { float: left; height: 130px; width: 100px; margin-left: 20px; margin-top: 20px; } .table-road { background-color: #ffff00; border: solid 1px #999; } .div-highlight { border: solid 1px #6dbde4 !important; background-color: #dceaf2 !important; } .img-btn { cursor: pointer; margin: 3px; } .img-btn2 { cursor: pointer; margin-left: 10px; } .table-addroads { width: 100%; } .table-addroads tr td:first-child { text-align: right; } .table-addroads tr td { height: 30px; padding: 3px; } .input-green { background-color: green; } </style> <script type="text/javascript" src="/UploadFiles/2021-04-02/jquery-1.8.2.js"> <p> 效果图:</p> <p><a href="javascript:;" onclick="showimg('/UploadFiles/2021-04-02/2016327112401909.jpg');"><img src="/UploadFiles/2021-04-02/2016327112401909.jpg" alt="ASP.NET MVC Layout如何嵌套" onmousewheel="return bbimg(this)" onload="javascript:resizepic(this)" border="0"/></a></p> <p>以上就是本文的全部内容,希望对大家的学习有所帮助。</p></div> </div> </div> <div class="share"> </div> <div class="nextinfo"> <p>上一篇:<a href="/3g/1/134706.html" title="ASP.NET中JQuery+AJAX调用后台">ASP.NET中JQuery+AJAX调用后台</a></p> <p>下一篇:<a href="/3g/1/134708.html" title="ASP.NET MVC中HtmlHelper控件7个大类中各个控件使用详解">ASP.NET MVC中HtmlHelper控件7个大类中各个控件使用详解</a></p> </div> <div class="otherlink"> <h2>最新资源</h2> <ul> <li><a href="/3g/1/623703.html" title="群星《奔赴!万人现场 第2期》[FLAC/分轨]">群星《奔赴!万人现场 第2期》[FLAC/分轨]</a></li> <li><a href="/3g/1/623702.html" title="群星《奇妙浪一夏 (上海迪士尼度假区音乐">群星《奇妙浪一夏 (上海迪士尼度假区音乐</a></li> <li><a href="/3g/1/623701.html" title="群星《奇妙浪一夏 (上海迪士尼度假区音乐">群星《奇妙浪一夏 (上海迪士尼度假区音乐</a></li> <li><a href="/3g/1/623700.html" title="【古典音乐】詹姆斯·高威《季节》1993[WA">【古典音乐】詹姆斯·高威《季节》1993[WA</a></li> <li><a href="/3g/1/623699.html" title="贝拉芳蒂《卡里普索之王》SACD[WAV+CUE]">贝拉芳蒂《卡里普索之王》SACD[WAV+CUE]</a></li> <li><a href="/3g/1/623698.html" title="小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE">小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE</a></li> <li><a href="/3g/1/623697.html" title="群星《欢迎来到我身边 电影原声专辑》[32">群星《欢迎来到我身边 电影原声专辑》[32</a></li> <li><a href="/3g/1/623696.html" title="群星《欢迎来到我身边 电影原声专辑》[FL">群星《欢迎来到我身边 电影原声专辑》[FL</a></li> <li><a href="/3g/1/623695.html" title="雷婷《梦里蓝天HQⅡ》 2023头版限量编号低">雷婷《梦里蓝天HQⅡ》 2023头版限量编号低</a></li> <li><a href="/3g/1/623694.html" title="群星《2024好听新歌42》AI调整音效【WAV分">群星《2024好听新歌42》AI调整音效【WAV分</a></li> </ul> </div> </div> <div class="sidebar"> </div> <div class="sidebar"> 友情链接:<a href="http://www.imxmx.com/" title="杰晶网络" target="_blank">杰晶网络</a> <a href="/" title="DDR爱好者之家" target="_blank">DDR爱好者之家</a> <a href="http://www.nqxw.com/" title="南强小屋" target="_blank">南强小屋</a> <a href="http://www.paidiu.com/" title="黑松山资源网" target="_blank">黑松山资源网</a> <a href="http://www.dyhadc.com/" title="白云城资源网" target="_blank">白云城资源网</a> <a href="/sitemap1.xml">站点地图</a> <a href="/sitemap.xml">SiteMap</a> </div> </article> <footer> <p>Design by <a href="http://m.ddrfans.com">DDR爱好者之家</a> <a href="http://m.ddrfans.com">http://m.ddrfans.com</a></p> </footer> <script src="/images3g/nav.js"></script> <script type="text/javascript"> jQuery.noConflict(); jQuery(function() { var elm = jQuery('#left_flow2'); var startPos = jQuery(elm).offset().top; jQuery.event.add(window, "scroll", function() { var p = jQuery(window).scrollTop(); jQuery(elm).css('position', ((p) > startPos) ? 'fixed' : ''); jQuery(elm).css('top', ((p) > startPos) ? '0' : ''); }); }); </script> </body> </html>