jQWidgets Forums

jQuery UI Widgets Forums Grid Internal Server Error

This topic contains 2 replies, has 2 voices, and was last updated by  NickBurns 10 years, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Internal Server Error #68866

    NickBurns
    Participant

    I have setup a grid that loads fine with some data and returns “Internal Server Error” with other data returned by a web service. The error is not coming from the Web Service but it is happening when populating the dataAdapter. What is the best way to find what row is causing the error?

    function loadActivityGrid() {
        intCompanyValue = $('#hdnCompanyID').val();
    
        if (intCompanyValue != "0" && blnActivityLoaded == false) {
            var source = {
                type: "GET",
                datatype: "json",
                datafields: [
                    { name: 'intNoteID', type: 'long' },
                    { name: 'ActType' },
                    { name: 'Employee_Name' },
                    { name: 'appt_date', type: 'date' },
                    { name: 'activity_completed_date', type: 'date' },
                    { name: 'OutcomeNotes' },
                    { name: 'ContactName' }
                ],
                url: 'WebService.asmx/loadActivity',
                data: { intCompanyID: intCompanyValue },
                cache: false,
                root: 'data',
                async: true
            };
    
            var dataAdapter = new $.jqx.dataAdapter(source,
            {
                contentType: 'application/json; charset=utf-8',
                downloadComplete: function (data, textStatus, jqXHR)
                {
                    return data.d;
                },
                loadError: function (jqXHR,status,error) {alert("loadError: " + error); }
            });
    
            $("#grdActivities").on('bindingcomplete', function (event) {
                $("#grdActivities").jqxGrid('endupdate');
            });
    
            var viewBtnRenderer = function (row, columnfield, value, defaulthtml, columnproperties) {
                return '<span style="margin: 4px; float: ' + columnproperties.cellsalign + '; vertical-align:middle;"><input type="button" value="View" class="btn_small" onclick="viewActivity(' + value + ');"></span>';
            }
    
            $("#grdActivities").jqxGrid({
                width: 870,
                height: 260,
                source: dataAdapter,
                sortable: true,
                filterable: true,
                pageable: true,
                autoheight: true,
                columnsresize: true,
                autorowheight: true,
                columns: [
                    { text: '', datafield: 'intNoteID', cellsrenderer: viewBtnRenderer, width: 50 },
                    { text: 'Type', dataField: 'ActType', width: 75 },
                    { text: 'Assigned To', dataField: 'Employee_Name', width: 125 },
                    { text: 'Scheduled<br>Date', dataField: 'appt_date', cellsformat: 'd', cellsalign: 'right', width: 75 },
                    { text: 'Date<br>Completed', dataField: 'activity_date_completed', cellsformat: 'd', cellsalign: 'right', width: 75 },
                    { text: 'Outcome/Notes', dataField: 'OutcomeNotes', width: 470 }
          
                ]
            });
            blnActivityLoaded = true;
        }
    }
    Internal Server Error #68878

    Peter Stoev
    Keymaster

    Hi NickBurns,

    If loadError is called this means that the Ajax call to your web service has failed. We are not aware why. It could be due to your service’s configuration, your server configuration or something else coming from the Server script or wrong url, type, datatype.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Internal Server Error #68918

    NickBurns
    Participant

    I found the issue. It was the size of the JSON data being returned and asp.net defaults to basically 100kb. I added the below code to my web.config and now it works!

      <system.web.extensions>
        <scripting>
          <webServices>
            <jsonSerialization maxJsonLength="50000000"/>
          </webServices>
        </scripting>
      </system.web.extensions>

    Thanks microsoft for the worthless error message “Internal Server Error”.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.