Here is my jQuery script code snippet. The script works perfectly and stores the data array/object in a variable called dataBLL.
var dataBLL = [];
$('#mytable tr').each(function (i) {
dataBLL.push({
id: $(this).find('td:eq(0)').text(),
ctype: $(this).find('td:eq(1)').text(),
cpath: $(this).find('td:eq(2)').text(),
ckey: $(this).find('td:eq(3)').text(),
ckey: $(this).find('td:eq(4) input:frist').val(),
});
$.ajax ({
url:"User/BllBtn",
type:"POST",
data:"dataBll="JSON.stringify(dataBLL);
dataType: "json",
success: function (e) {
alert("sucess");
}})
However, I am facing an issue with sending this object/Array to my controller in order to utilize its data and iterate through each row entry.
This is the signature of my controller:
[HttpPost]
public ActionResutl BllBtn(List<string> dataBll)
{
}
I would appreciate guidance on how to convert this object into a list so that I can easily loop through it.