Home > database >  DataTables Requested unknown parameter 'PageId'
DataTables Requested unknown parameter 'PageId'

Time:02-02

I am running into the following error trying to load DataTables Objects data (enter image description here

134 matches the character count of the json data (provided in answer). For some reason it appears DataTables is not seeing the json object and parsing individual characters? Just not sure why it would be doing this?

CodePudding user response:

Your columns block should be:

                    columns : [
                        {
                            'data' : 'PageId'
                        },
                        {
                            'data' : 'SchemaName'
                        },
                        {
                            'data' : 'Name'
                        },
                        {
                            'data' : 'LastModified'
                        },
                        {
                            'data' : 'LastModifiedUser'
                        }
                    ],

You should also be sending your data from the Controller like this:

return Json(schemaData);

You do not need to serialize your data when you are returning a JSON since this will already return data in JSON format and if you use JsonConvert.SerializeObject then you are converting it twice which the DataTable plugin does not like.

  •  Tags:  
  • Related