Hi,
I need to send each rows of my grid to my C# controller.
In my js code, i use this way :
$("#myButton").click(function () {
debugger;
var applicationSectionId = $("#myComboBoxSections").data("kendoComboBox").value();
var providerName = $("#myTbName").val();
var typeProvider = $("#myComboBoxTypes").data("kendoComboBox").value();
var sensTraitement = $("#myComboBoxSens").data("kendoComboBox").value();
var parameters = $('#myGid').data('kendoGrid')._data;
$.post(_pathRoot + "AddNewProvider",
{
applicationSectionId: applicationSectionId,
providerName: providerName,
typeProvider: typeProvider,
sensTraitement: sensTraitement,
parameters : parameters
})
.done(function (result) {
debugger;
});
Here is m model in the grid :
model: {
fields: {
Nom: { type: "string" },
Valeur: { type: "string" }
}
}
My controller method, in the .cs file is like this:
public async Task<JsonResult> AddNewProvider(int? applicationSectionId, string providerName, string typeProvider, string sensTraitement, object parameters )
Each time, all data are effectively sent, except "parameters" which is {string[1]} in VS 2012 debugger, and is finally empty.
Wich class should i use tu get rows in my controller ?
Thanks in advance.
I need to send each rows of my grid to my C# controller.
In my js code, i use this way :
$("#myButton").click(function () {
debugger;
var applicationSectionId = $("#myComboBoxSections").data("kendoComboBox").value();
var providerName = $("#myTbName").val();
var typeProvider = $("#myComboBoxTypes").data("kendoComboBox").value();
var sensTraitement = $("#myComboBoxSens").data("kendoComboBox").value();
var parameters = $('#myGid').data('kendoGrid')._data;
$.post(_pathRoot + "AddNewProvider",
{
applicationSectionId: applicationSectionId,
providerName: providerName,
typeProvider: typeProvider,
sensTraitement: sensTraitement,
parameters : parameters
})
.done(function (result) {
debugger;
});
Here is m model in the grid :
model: {
fields: {
Nom: { type: "string" },
Valeur: { type: "string" }
}
}
My controller method, in the .cs file is like this:
public async Task<JsonResult> AddNewProvider(int? applicationSectionId, string providerName, string typeProvider, string sensTraitement, object parameters )
Each time, all data are effectively sent, except "parameters" which is {string[1]} in VS 2012 debugger, and is finally empty.
Wich class should i use tu get rows in my controller ?
Thanks in advance.