Handle and use Datatables data in asp.net handler

Handle and use Datatables data in asp.net handler

alim91alim91 Posts: 2Questions: 2Answers: 0

hello everybody, i am working on a asp.net(C#) project and i am also using html5,javascript,css.
i have a datatables and i get all row data by fngetdata() function and i send to handler, but i can't handle it and insert every row data into sql databases. here some parts of my code :

-- initialize datatables with loading data form other handler :
var oTable = $("#nutrition-info").dataTable({
"sAjaxSource": "HandlerGetNutrion.ashx?P=" + proid
});

-- send data to handler using ajax jquery request :
var data = oTable.fnGetData();
var sdata = JSON.stringify(data);
$.ajax({
url: "HandlerSaveNutrition.ashx",
data: { data: sdata },
type: 'POST',
dataType: "json"

            })

-- in console here what i see :
data:[["Energy","15401 kg","811 kg","Keep Cool & Dry","Made in EU"],["Energy","3681 kg","191 cal","Keep Cool & Dry","Made in EU"],["Protein","1.51 kg","0.51 kg","Keep Cool & Dry",".....]]

any help please

This discussion has been closed.