Error: Requested unknown parameter '0' for row 0, column 0.

Error: Requested unknown parameter '0' for row 0, column 0.

eLRobboeLRobbo Posts: 3Questions: 1Answers: 0

It appears that this is related to the fact that I am passing back an array of objects. I have tried everything that I could find in documentation (here and googleville), but to no avail. Any help? ASP.net, C#, backend. I believe I am passing back all required parameters. A working (???) example here: http://lektrikpuke-001-site1.ctempurl.com/

This question has an accepted answers - jump to answer

Answers

  • eLRobboeLRobbo Posts: 3Questions: 1Answers: 0

    I realize now I should have said, " an example showing this behavior," and not working example. To be clear, it does not work correctly.

  • kthorngrenkthorngren Posts: 20,342Questions: 26Answers: 4,776
    Answer ✓

    You have this code commented out:

                        /*, "columns": [
                            { "data": "Folder" },
                            { "data": "Pinned" },
                            { "data": "StartDate" },
                            { "data": "EndDate" }
                        ]*/
    

    This should work. But you do need to move it outside of the ajax config options. Like this:

                    "ajax": {
                        "url": "../../Home/GetDTO",
                        "data": function (d) {
                            d.postID = globalPinToFolderSearchID;
                        }
                    },
                    "columns": [
                            { "data": "Folder" },
                            { "data": "Pinned" },
                            { "data": "StartDate" },
                            { "data": "EndDate" }
                     ]
                });
    
    

    Also noticed you have two icons for the sorting arrows. This indicates conflicting CSS files. You have:

        <link href="/Scripts/DataTables/DataTables-1.10.18/css/dataTables.bootstrap.css" rel="stylesheet" />
        <link href="/Scripts/DataTables/DataTables-1.10.18/css/jquery.dataTables.css" rel="stylesheet" />
    
    

    When using dataTables.bootstrap.css . you don't want jquery.dataTables.css. Try removing jquery.dataTables.css.

    Kevin

  • eLRobboeLRobbo Posts: 3Questions: 1Answers: 0

    Genius! I didn't realize I had columns in the ajax section. Thank you for your second set of eyes. =) Your fix is shown on: http://lektrikpuke-001-site1.ctempurl.com/Home/Contact

    Thanks again for your help.

This discussion has been closed.