According to me you can do this 2 way.
Code 1
In your *.aspx file or *.js file add below code.
var senders = [];
$("#btn_input_kaydet").click(function () {
var input = $("#dd_input").text();
var trigger = $("#dd_input_trigger").text();
$("#dynamic_input_field tr").each(function (i) {
senders.push($(this).find('td input').attr('name'));
});
$.ajax({
type: "POST",
url: "yourpage.aspx/method",
data: '{array: ' + JSON.stringify(senders) + ', input: "' + input + '", trigger: "' + trigger + '" }',
traditional: true,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
senders = []; // Reset this so on Next Click you don't get same data
// TODO: Success Handler
},
error: function () {
senders = []; // Reset this so on Next Click you don't get same data
// TODO: Fail Handler
}
});
});
On your server side code file use below
[WebMethod]
public static void method(List<string> array, string input, string trigger)
{
// TODO: Further Action
}
In this Asp.Net deserialize JSON to string LIST Automatically. Here, is good explanation for JSON Serialization and Deserialization in ASP.NET.
Code 2
I used to do with this way when I was not having knowledge of JSON Serialization and Deserialization in ASP.NET
In your *.aspx file or *.js file add below code.
var senders = "";
$("#btn_input_kaydet").click(function () {
var input = $("#dd_input").text();
var trigger = $("#dd_input_trigger").text();
$("#dynamic_input_field tr").each(function (i) {
senders += ","+$(this).find('td input').attr('name');
});
$.ajax({
type: "POST",
url: "yourpage.aspx/method",
data: '{array: ' + senders + ', input: "' + input + '", trigger: "' + trigger + '" }',
traditional: true,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
// TODO: Success Handler
},
error: function () {
// TODO: Fail Handler
}
});
});
On your server side code file use below
[WebMethod]
public static void method(string strArray, string input, string trigger)
{
string[] array = strArray.Trim(",").Split(',');
// TODO: Further Action
}
In both way you can achieve your goal.