mvc html 404错误页面模板,MVC5开发遇到404错误

此代码段展示了使用ASP.NET MVC创建一个数据网格的实现,包括查询、创建、编辑、详情和删除功能。它利用jQuery Datagrid插件进行数据加载、排序和分页,并实现了按钮操作的事件绑定,如查询、新建、编辑和删除记录。当用户执行操作时,会触发相应的确认提示或页面刷新。
摘要由CSDN通过智能技术生成

1 @using Apps.Web.Core;2 @using Apps.Models.Sys;3 @using Apps.Locale;4 @{5 ViewBag.Title = "ProjectItems";6 Layout = "~/Views/Shared/_Index_Layout.cshtml";7 List perm = null;8 }9

10

11 @Html.ToolButton("btnQuery", "fa fa-search", Resource.Query,ref perm, "Query", true)12 @Html.ToolButton("btnCreate", "fa fa-plus", Resource.Create,ref perm, "Create", true)13 @Html.ToolButton("btnEdit", "fa fa-pencil", Resource.Edit,ref perm, "Edit", true)14 @Html.ToolButton("btnDetails", "fa fa-list", Resource.Details,ref perm, "Details", true)15 @Html.ToolButton("btnDelete", "fa fa-trash", Resource.Delete,ref perm, "Delete", true)16

17

18

19

20 @Html.Partial("~/Views/Shared/_Partial_AutoGrid.cshtml")21

22 $(function () {23 $('#List').datagrid({24 url: '@Url.Action("GetList")',25 width:SetGridWidthSub(10),26 methord: 'post',27 height: SetGridHeightSub(45),28 fitColumns: true,29 sortName: 'CreateTime',30 sortOrder: 'desc',31 idField: 'ID',32 pageSize: 15,33 pageList: [15, 20, 30, 40, 50],34 pagination: true,35 striped: true, //奇偶行是否区分

36 singleSelect: true,//单选模式37 //rownumbers: true,//行号

38 columns: [[39 { field: 'ID', title: 'ID', width: 80,sortable:true},40 { field: 'Name', title: 'Name', width: 80,sortable:true},41 { field: 'Status', title: 'Status', width: 80,sortable:true},42 { field: 'InvestTotal', title: 'InvestTotal', width: 80,sortable:true},43 { field: 'ConScaleContent', title: 'ConScaleContent', width: 80,sortable:true},44 { field: 'InvestmentSubject', title: 'InvestmentSubject', width: 80,sortable:true},45 { field: 'Trade', title: 'Trade', width: 80,sortable:true},46 { field: 'WarehouseYear', title: 'WarehouseYear', width: 80,sortable:true},47 { field: 'DeclarationCompany', title: 'DeclarationCompany', width: 80,sortable:true},48 { field: 'DeclarationDate', title: 'DeclarationDate', width: 80,sortable:true},49 { field: 'originatorId', title: 'originatorId', width: 80,sortable:true},50 { field: 'CreateTime', title: 'CreateTime', width: 80,sortable:true}51 ]]52 });53 });54 //ifram 返回

55 function frameReturnByClose() {56 $("#modalwindow").window('close');57 }58 function frameReturnByReload(flag) {59 if(flag)60 $("#List").datagrid('load');61 else

62 $("#List").datagrid('reload');63 }64 function frameReturnByMes(mes) {65 $.messageBox5s('@Resource.Tip', mes);66 }67 $(function () {68 $("#btnCreate").click(function () {69 $("#modalwindow").html("");70 $("#modalwindow").window({ title: '@Resource.Create', width: 700, height: 400, iconCls: 'fa fa-plus' }).window('open');71 });72 $("#btnEdit").click(function () {73 var row = $('#List').datagrid('getSelected');74 if (row != null) {75 $("#modalwindow").html("");76 $("#modalwindow").window({ title: '@Resource.Edit', width: 700, height: 400, iconCls: 'fa fa-pencil' }).window('open');77 } else { $.messageBox5s('@Resource.Tip', '@Resource.PlaseChooseToOperatingRecords'); }78 });79 $("#btnDetails").click(function () {80 var row = $('#List').datagrid('getSelected');81 if (row != null) {82 $("#modalwindow").html("");83 $("#modalwindow").window({ title: '@Resource.Details', width: 700, height: 400, iconCls: 'fa fa-list' }).window('open');84 } else { $.messageBox5s('@Resource.Tip', '@Resource.PlaseChooseToOperatingRecords'); }85 });86 $("#btnQuery").click(function () {87 var queryStr = $("#txtQuery").val();88 if (queryStr == null) {89 queryStr = "%";90 }91 $("#List").datagrid("load", { queryStr: encodeURI(queryStr) });92

93 });94 $("#btnDelete").click(function () {95 var row = $('#List').datagrid('getSelected');96 if (row != null) {97 $.messager.confirm('@Resource.Tip', '@Resource.YouWantToDeleteTheSelectedRecords', function (r) {98 if(r) {99 $.post("@Url.Action("Delete")?id=" +row.Id, function (data) {100 if (data.type == 1)101 $("#List").datagrid('load');102 $.messageBox5s('@Resource.Tip', data.message);103 }, "json");104

105 }106 });107 } else { $.messageBox5s('@Resource.Tip', '@Resource.PlaseChooseToOperatingRecords'); }108 });109 });110

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值