0

On page i have jqGrid. I use next function to fill grid:

function LoadActionReportDetails() {
var hostURL = window.location + '/GetActionReportDetails';
try {
    jQuery("#jqTable").jqGrid({
        url: hostURL,
        mtype: "GET",
        data: {},
        ajaxGridOptions: { contentType: "application/json; charset=utf-8" },
        datatype: "json",
        serializeGridData: function(postData) {
            return JSON.stringify(postData);
        },
        jsonReader: {
            root: function(obj) { return obj.d; },
            page: function(obj) { return 1; },
            total: function(obj) { return 1; },
            records: function(obj) { return obj.d.length; },
            id: "0",
            cell: "",
            repeatitems: false
        },
        height: "100%",
        colNames: ["Session ID", "Company"], "Username", "Full Name", "Phone", "Email", "Activities Opened", "Submission Title", "Form Opened Time", "Session Start Time"],
        colModel: [
            { name: 'SessionID', index: 'SessionID', width: 150, search: true, stype: 'text', align: "left", sortable: false },
            { name: "Company", index: "Company", width: 100, align: "left", sortable: false },
            { name: "Username", index: "Username", width: 100, align: "left", sortable: false },
            { name: "FullName", index: "FullName", width: 100, align: "left", sortable: false },
            { name: "Phone", index: "Phone", width: 100, align: "left", sortable: false },
            { name: "Email", index: "Email", width: 150, align: "left", sortable: false },
            { name: "Activities_Opened", index: "Activities_Opened", width: 100, align: "left", sortable: false },
            { name: "Submission_Title", index: "Submission_Title", width: 100, align: "left", sortable: false },
            { name: "FormOpenedTime", index: "FormOpenedTime", width: 180, align: "left", formatter: 'date', formatoptions: { newformat: 'm-d-Y h:i:s A' }, sortable: false },
            { name: "SessionStartTime", index: "SessionStartTime", width: 180, align: "left", formatter: 'date', formatoptions: { newformat: 'm-d-Y h:i:s A' }, sortable: false }
        ],
        width: 830,
        autowidth: true,
        pager: '#jqTablePager',
        rowNum: 10,
        rowList: [10, 20, 50, 100],
        sortname: "SessionID",
        sortorder: "asc ",
        viewrecords: true,
        loadonce: true
    });
} catch (e) {
    alert(e.name);
}
try {
    Loadnavigation();
} catch (e) {
    alert(e.name);
} 

}

function Loadnavigation() {
    jQuery("#jqTable").navGrid("#jqTablePager",
            { refresh: true, add: false, edit: false, del: false },
                {}, // settings for edit
                {}, // settings for add
                {}, // settings for delete
                { sopt: ["cn"] } // Search options. Some options can be set on column level
         );
}

Method GetActionReportDetails:

[WebMethod]
    [ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = true)]
    public static List<GetActionReportDetailsResult> GetActionReportDetails()
    {
        try
        {
            IActionReport objActionReport = Factory.ActionReport();
            var actionList = objActionReport.GetActionReportDetails();
            return actionList;
        }
        catch (Exception e)
        {
            throw new Exception(e.Message);
        }
    }

Problem : When i go to this page where jqGrid exists, i get server Error (500).

"NetworkError: 500 Internal Server Error - /ActionReport.aspx/GetActionReportDetails?{%22_search%22:false,%22nd%22:1417613200222,%22rows%22:10,%22page%22:1,%22sidx%22:%22SessionID%22,%22sord%22:%22asc%20%22}"

I try to degub code - on Server side no error, filled list are returned. Js code debug also didn't give any tips where is problem.

Any suggestions? Thanks.

demo
  • 6,038
  • 19
  • 75
  • 149
  • You can try to use `postData: ""` instead of `data: {}`. Another possibility would be to save the code of `GetActionReportDetails` in `.asmx` file instead of `.aspx`. – Oleg Dec 03 '14 at 18:20
  • You can compare other attributes which you use with the project from [the old answer](http://stackoverflow.com/a/6296601/315935). You don't really need to add any input parameters to `GetActionReportDetails`. – Oleg Dec 03 '14 at 18:27
  • @Oleg, thanks for reply. First : change to postData - didn't help. Second - .asmx i don't want to add now, because few days before this jqGrid works. Weird. Third : try to compare with old answer attributes, but also didn't help – demo Dec 04 '14 at 10:13

0 Answers0