本文介绍了我使用ajax webmethod创建了jqgrid它的工作正常,但peoblem是当我尝试将我的.aspx页面分配给masterpage我没有得到任何数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%--<link href="Themes/custom19/jquery-ui.css" rel="stylesheet" type="text/css" />--%>
<link href="Themes/custom16/jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="JQGrid/jquery-1.8.3.js" type="text/javascript"></script>
<script src="JQGrid/jquery-ui-1.9.2.custom.js" type="text/javascript"></script>
<script src="JQGrid/grid.locale-en.js" type="text/javascript"></script>
<script src="JQGrid/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="JQGrid/jquery.dynDateTime.js" type="text/javascript"></script>
<script src="JQGrid/calendar-en.js" type="text/javascript"></script>
<link href="JQGrid/calendar-system.css" rel="stylesheet" type="text/css" />
<link href="JQGrid/ui.jqgrid.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(document).ready(function () {
$('#fromdate').datepicker({
maxDate: '0',
changeYear: true,
yearRange: "-15:+0",
dateFormat: 'yy-mm-dd',
onSelect: function (selected) {
$("#todate").datepicker("option", "minDate", selected)
}
});
$('#todate').datepicker({
maxDate: '0',
changeYear: true,
yearRange: "-15:+0",
dateFormat: 'yy-mm-dd',
onSelect: function (selected) {
$("#fromdate").datepicker("option", "maxDate", selected)
}
});
});
</script>
<script type="text/javascript">
$(document).ready(function () {
$("#btn").click(function () {
$("#datagrid").GridUnload();
gridLoad();
});
});
</script>
<script type="text/javascript">
function gridLoad() {
$("#datagrid").jqGrid({
url: 'Default.aspx/ConvertDataTabletoString',
datatype: 'json',
mtype: 'POST',
serializeGridData: function (postData) {
postData.fromdate = $('#fromdate').val();
postData.todate = $('#todate').val();
postData.project = $('#DropDownList1').val();
postData.dailnum = $('#Text3').val();
postData.wwid = $('#Text1').val() ;
postData.extension = $('#Text2').val();
postData.sites = $('#Text4').val();
// return JSON.stringify(postData);
return JSON.stringify(postData);
},
ajaxGridOptions: { contentType: "application/json" },
loadonce: true,
colNames: ['Call Type', 'Total No of Calls', 'Total Call Duration', 'Total Cost(INR)'],
colModel: [
{ name: 'calltype', index: 'toc', key: true, sortable: true, sorttype: 'int', width: '317', align: 'center' },
{ name: 'TotalNoofCalls', index: 'TotalNoofCalls', width: '297', align: 'center' },
{ name: 'TotalCallDuration', index: 'TotalCallDuration', width: '270', align: 'center', formatoptions: { srcformat: 'ISO860Long', newformat: 'G:H:S'} },
{ name: 'Cost', index: 'price', width: '297', align: 'center' }
],
pagerpos: 'center',
pager: '#navGrid',
rowNum: 20,
rownumbers: true,
rowList: [20, 50, 100],
width: 900,
viewrecords: true,
toppager: true,
gridview: true,
jsonReader: {
page: function (obj) { return 1; },
total: function (obj) { return 1; },
records: function (obj) { return obj.d.length; },
root: function (obj) { return obj.d; },
repeatitems: false,
id: "0"
},
footerrow: true,
loadComplete: function (clr) {
var costSum = $('#datagrid').jqGrid('getCol', 'Cost', false, 'sum');
costSum = costSum.toFixed(2);
var totalCalls = $('#datagrid').jqGrid('getCol', 'TotalNoofCalls', false, 'sum');
$('#datagrid').jqGrid('footerData', 'set', { 'TotalNoofCalls': " TotalCalls: " + totalCalls, 'Cost': "TotalCost: " + costSum });
},
caption: 'Admin Summary'
});
$('#datagrid').jqGrid('navGrid', '#navGrid',
{
edit: true,
add: true,
del: true,
search: true,
searchtext: "Search",
addtext: "Add",
edittext: "Edit",
deltext: "Delete",
cloneToTop: true
});
};
</script>
</head>
<body>
< / body>
< / html>
我尝试过:
i我试图将我的.aspx页面分配给母版页文件
</body>
</html>
What I have tried:
i am trying to assign my .aspx page to masterpage file
推荐答案
这篇关于我使用ajax webmethod创建了jqgrid它的工作正常,但peoblem是当我尝试将我的.aspx页面分配给masterpage我没有得到任何数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!