ASP.NET MVC Layout如何嵌套_.docx

上传人:啊飒飒 文档编号:11644243 上传时间:2021-08-27 格式:DOCX 页数:38 大小:19.05KB
返回 下载 相关 举报
ASP.NET MVC Layout如何嵌套_.docx_第1页
第1页 / 共38页
ASP.NET MVC Layout如何嵌套_.docx_第2页
第2页 / 共38页
ASP.NET MVC Layout如何嵌套_.docx_第3页
第3页 / 共38页
ASP.NET MVC Layout如何嵌套_.docx_第4页
第4页 / 共38页
ASP.NET MVC Layout如何嵌套_.docx_第5页
第5页 / 共38页
亲,该文档总共38页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《ASP.NET MVC Layout如何嵌套_.docx》由会员分享,可在线阅读,更多相关《ASP.NET MVC Layout如何嵌套_.docx(38页珍藏版)》请在三一文库上搜索。

1、ASP.NET MVC Layout如何嵌套_ 这篇文章主要为大家具体介绍了ASP.NET MVC Layout如何嵌套,ASP.NET MVC Layout进行嵌套的方法,感爱好的小伙伴们可以参考一下 挺直上代码: 模板页Layout.cshtml代码(路径/Views/Backstage/MachineMng/Layout.cshtml): ViewBag.Title = 货机管理; !DOCTYPE html html head titleViewBag.Title/title style type=text/css body font-size: 12px; padding: 0; m

2、argin: 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 scr

3、ipt type=text/javascript src=/Scripts/jquery-1.8.2.js/script script type=text/javascript function gotourl(url) window.location = url; /script /head body div style=width: 960px; margin: auto; background-color: #fff; padding: 7px; div style=height: 110px; border: solid 1px #999; div style=float: left;

4、 width: 105px; height: 65px; margin: 3px; text-align: center; border: solid 1px #999; div style=font-size: 16px; margin-top: 12px; IMU br / 12090 /div /div div style=float: right; padding: 5px; margin-top: 5px; div style=float: left; 欢迎您,spanXXX/span 【退出】 /div div style=float: left; margin-left: 50p

5、x; string weekDays = 星期天, 星期一, 星期二, 星期三, 星期四, 星期五, 星期六 ; 当前时间 DateTime.Now.ToString(yyyy-MM-dd( + weekDays(int)DateTime.Now.DayOfWeek + )HH:mm) /div div style=float: left; margin-left: 50px; margin-right: 5px; 关心中心 /div /div div style=margin-top: 76px; ul class=ul-menu li onclick=gotourl(Url.Content

6、(/Backstage/MachineMng/MachineInfo/Index)货机/li li onclick=gotourl(Url.Content(/Backstage/MachineMng/StartCargo/Index)运营/li li交易/li li系统/li /ul /div /div RenderBody() /div /body /html 模板页RoadSetLayout.cshtml代码:(路径/Views/Backstage/MachineMng/RoadSetLayout.cshtml): ViewBag.Title = 货道设置; Layout = Url.Co

7、ntent(/Views/Backstage/MachineMng/Layout.cshtml); !DOCTYPE html html head titleViewBag.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; widt

8、h: 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

9、 src=/Scripts/jquery-1.8.2.js/script script type=text/javascript src=/Scripts/My97DatePicker/WdatePicker.js/script script type=text/javascript $(function () ); /script /head body div style=height: 200px; border: solid 1px #999; border-top: 0; div style=float: left; width: 200px; height: 150px; borde

10、r: solid 1px #999; margin: 20px; padding: 5px; div style=text-align: center; font-size: 18px; line-height: 25px; padding-top: 10px; 货机现在运行正常 br / 连续运行3天 72小时 /div div style=padding-top: 10px; line-height: 20px; 货机数据已经与平台数据同步,无需插数据盘。 请插入数据盘完成数据同步更新/数据盘已插入,数据传输完成10% /div /div div style=float: right; w

11、idth: 600px; height: 160px; margin: 20px; margin-right: 50px; div class=div-button1 style=margin-left: 100px; cursor: default; background-color: #eee; 暂停货机 /div div onclick=gotourl(Url.Content(/Backstage/MachineMng/StartCargo/Index) class=div-button1 style=margin-left: 50px; 启动货机 /div div style=floa

12、t: left; width: 100%; height: 33px; line-height: 33px; text-align: center; div style=float: left; margin-left: 100px; 货机暂停才可以进行以下操作:以下操作完成须启动货机 /div /div div style=float: left; width: 100%; height: 60px; line-height: 60px; text-align: center; div class=div-arrow style=margin-left: 150px; img alt= sr

13、c=Url.Content(/Images/Cargo/roadset_arrow_down.png) / /div div class=div-arrow style=margin-left: 160px; img alt= src=Url.Content(/Images/Cargo/roadset_arrow_up.png) / /div /div div class=div-button2 onclick=gotourl(Url.Content(/Backstage/MachineMng/RoadSet/Index) style=margin-left: 50px; 商品货道设置 /di

14、v div class=div-arrow2 style= img alt= src=Url.Content(/Images/Cargo/roadset_arrow_right.png) / /div div class=div-button2 style=margin-left: 5px; 现金管理理 /div div class=div-arrow2 style= img alt= src=Url.Content(/Images/Cargo/roadset_arrow_right.png) / /div div class=div-button2 style=margin-left: 5p

15、x; 货机运维 /div /div /div RenderBody() /body /html Index页面代码(路径/Views/Backstage/MachineMng/RoadSet/Index.cshtml): ViewBag.Title = 货道设置; Layout = Url.Content(/Views/Backstage/MachineMng/RoadSetLayout.cshtml); !DOCTYPE html html head titleViewBag.Title/title link type=text/css href=/Scripts/jquery-easyui

16、-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: 80p

17、x; 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: 12p

18、x; 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 !imp

19、ortant; .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 sr

20、c=/Scripts/jquery-1.8.2.js/script script type=text/javascript src=/Scripts/My97DatePicker/WdatePicker.js/script script type=text/javascript src=/Scripts/jquery-easyui-1.4.1/jquery.easyui.min.js/script script type=text/javascript src=/Scripts/SimpoWindow.js/script script type=text/javascript $(functi

21、on () $(#tdboxs).load(Boxs?cargoCode= + ViewBag.cargoCode + t= + new Date().valueOf(), function (data) $(.div-box:first).click(); ); ); /显示货柜的货道 function showBox(obj, boxId) $(.div-box).removeClass(div-highlight); $(obj).addClass(div-highlight); $(#divfloors).load(Floors?boxId= + boxId + t= + new Da

22、te().valueOf(); /添加货柜 function addbox(addType) if (confirm(确定添加?) var cargoCode = ViewBag.cargoCode; var floorType = $(inputname=floorType:checked).val(); $.ajax( type: POST, url: Url.Content(/Backstage/MachineMng/RoadSet/AddBox), data: addType: addType, cargoCode: cargoCode, floorType: floorType ,

23、success: function (d) var data = eval( + d + ); if (data.ok) $(#tdboxs).load(Boxs?cargoCode= + cargoCode + t= + new Date().valueOf(), function (data) if (addType = 1) $(.div-box:first).click(); else $(.div-box:last).click(); ); else alert(添加失败: + data.msg); , error: function () alert(添加失败); ); /删除货柜

24、 function delbox(addType) if (confirm(确定删除?) var cargoCode = ViewBag.cargoCode; $.ajax( type: POST, url: Url.Content(/Backstage/MachineMng/RoadSet/DelBox), data: addType: addType, cargoCode: cargoCode , success: function (data) if (data = ok) if (addType = 1) $(.div-box:first).remove(); else $(.div-

25、box:last).remove(); $(.div-box:first).click(); else alert(删除失败 + data); , error: function () alert(删除失败); ); /添加货道 function addroad(obj, boxId, floor) $.ajax( type: POST, url: Url.Content(/Backstage/MachineMng/RoadSet/AddRoad), data: boxId: boxId, floor: floor , success: function (d) var data = eval

26、( + d + ); if (data.ok) var td = $(obj).parent().parent().parent().parent().find(td:first); td.find(#divroads_ + floor).load(Roads?boxId= + boxId + floor= + floor + t= + new Date().valueOf(); var roadNum = parseInt(td.find(.span-roadNum).text(), 10); td.find(.span-roadNum).html(roadNum + 1).toString

27、(); else alert(添加失败: + data.msg); , error: function () alert(添加失败); ); /删除货道 function delroad(obj, boxId, floor) if (confirm(确定删除?) $.ajax( type: POST, url: Url.Content(/Backstage/MachineMng/RoadSet/DelRoad), data: boxId: boxId, floor: floor , success: function (data) if (data = ok) var td = $(obj).

28、parent().parent().parent().parent().find(td:first); td.find(.div-road:last).remove(); var roadNum = parseInt(td.find(.span-roadNum).text(), 10); if (roadNum 0) td.find(.span-roadNum).html(roadNum - 1).toString(); else alert(删除失败 + data); , error: function () alert(删除失败); ); /添加货道层 function addfloor(

29、obj, boxId) $.ajax( type: POST, url: Url.Content(/Backstage/MachineMng/RoadSet/AddFloor), data: boxId: boxId , success: function (d) var data = eval( + d + ); if (data.ok) $(#divfloors).load(Floors?boxId= + boxId + t= + new Date().valueOf(); var div = $(obj).parent().parent(); var floorNum = parseIn

30、t(div.find(.span-floorNum).text(), 10); div.find(.span-floorNum).html(floorNum + 1).toString(); else alert(添加失败: + data.msg); , error: function () alert(添加失败); ); /删除货道层 function delfloor(obj, boxId) var div = $(obj).parent().parent().parent(); if (div.find(.table-floor).length 2) return; if (confir

31、m(确定删除?) $.ajax( type: POST, url: Url.Content(/Backstage/MachineMng/RoadSet/DelFloor), data: boxId: boxId , success: function (d) var data = eval( + d + ); if (data.ok) div.find(.table-floor:last).remove(); var floorNum = parseInt(div.find(.span-floorNum).text(), 10); div.find(.span-floorNum).html(f

32、loorNum - 1).toString(); else alert(删除失败: + data.msg); , error: function () alert(删除失败); ); /批量添加货道 function addroads(obj, boxId, floor) SimpoWin.showWin2(更换货箱, addroads, 240, 170); var windiv = $(#addroads); var btnOK = windiv.find(inputtype=button); btnOK.bind(click, function () var roadNum = wind

33、iv.find(selectname=roadNum).find(option:selected).val(); var roadSpec = windiv.find(selectname=roadSpec).find(option:selected).val(); $.ajax( type: POST, url: Url.Content(/Backstage/MachineMng/RoadSet/AddRoads), data: boxId: boxId, floor: floor, roadNum: roadNum, roadSpec: roadSpec , success: functi

34、on (d) var data = eval( + d + ); if (data.ok) var td = $(obj).parent().parent(); td.find(#divroads_ + floor).load(Roads?boxId= + boxId + floor= + floor + t= + new Date().valueOf(); td.find(.span-roadNum).html(data.roadNum.toString(); else alert(添加失败: + data.msg); , error: function () alert(添加失败); ); btnOK.unbind(click); SimpoWin.closeWin2(addroads); ); /script /head body div style=height: 30px; line-height: 30px; padding-top: 5px; border-left: solid 1px #999; border-right: solid 1px #

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 科普知识


经营许可证编号:宁ICP备18001539号-1