.Net 4.0 WebForms
.Net 4.0 WebForms
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
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
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?
Looks like https://datatables.net/reference/option/ajax answered my question.
Well for my case https://editor.datatables.net/reference/option/ajax.data
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?
@allan Any luck?
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