.Net 4.0 WebForms

.Net 4.0 WebForms

54696d2054696d20 Posts: 75Questions: 18Answers: 0

Right now I'm adding your datatables editor to a Webforms project with my own columns. I'm at the point where the code behind file will pass the data back on page load. Haven't loaded the datatables and json dll yet. I was wondering if the version we have will be an issue? Plus I have multiple datatables on one page (in tabs). How would I target that? If I can't, is there a way to do a normal ajax post to a code behind file/Method to populate the data?

Thanks

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    Editor's dll targets 4.5+. It should actually be possible to compile it for 4.0. I'll try that tomorrow and let you know.

    Allan

  • 54696d2054696d20 Posts: 75Questions: 18Answers: 0

    Cool, thanks. If I can't, is there a way to do a normal ajax post to a code behind file/Method to populate the data?

  • 54696d2054696d20 Posts: 75Questions: 18Answers: 0

    Looks like https://datatables.net/reference/option/ajax answered my question.

  • 54696d2054696d20 Posts: 75Questions: 18Answers: 0
  • 54696d2054696d20 Posts: 75Questions: 18Answers: 0

    Welp.. This just returns an error "DataTables warning: table id=studentsTab - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1"

    editor = new $.fn.dataTable.Editor({ ajax: { url: 'TestView.aspx/GetStudentTabData', data: function (d) { console.log(d); //return JSON.stringify(d); }, error: function (e) { console.log("Something Wrong. In getting students for table\n" + e.d); } }, table: "table#studentsTab",

    Debugging in VS. It never hits TestView.aspx/GetStudentTabData

    Any ideas?

  • 54696d2054696d20 Posts: 75Questions: 18Answers: 0

    @allan Any luck?

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin
    Answer ✓

    Hi,

    If you follow the instructions in the tech note linked to in the error message, what is the server returning? Most likely it will contain an error message.

    If you want to use CodeBehind, the documentation for that is here.

    I tried compiling the dll for .NET Framework 4.0.0 but wasn't able to find this Nuget for 4.0.0. It compiles no problem against 4.5.0, so if you are able to target .NET Framework 4.5.0 or later then that would help.

    Allan

This discussion has been closed.