I have an HTML table and would like to pass the content of the table into a controller method. I use JQuery to create an array then turn them into a JSON object.
var array_MACAddress = [];
var $MacAddress = $(".macaddress");
for (var i = 0, len = $MacAddress.length; i < len; i++) {
var $MAC = $($MacAddress[i]);
console.log($MAC.text()); ////for testing only!!!
array_MACAddress.push({
key: $MAC.data("key"),
value: $MAC.text()
});
};
(the code above it to create an array of a column called "MACAddress
"), then I use the code below to turn them into JSON object
var json_MACAddress = json.stringify(array_MACAddress);
How do I pass the JSON object into the controller method?
public ActionResult ActivationManagement(String jsonData)