I am facing an issue in the controller where I need to receive two parameters (detail and test). One parameter is a List of custom objects, while the other is a string. However, when I try to pass both parameters, I only manage to pass one (the list of objects) and end up receiving null values in the controller.
Below is the resulting JSON being sent to the controller:
[{
"detail": [{
"tag": "PIC330_620%2F_.PV_Out%23Value",
"color": "%2331c63e"
}, {
"tag": "A330_10%2F_.FbkFwdOut%23Value",
"color": "%238edeed"
},
// additional entries truncated for brevity
],
"test": "lolo"
}]
//Generate list of objects
function getViewDetail() {
// function implementation details omitted for brevity
}
// Call Ajax
function sendParameters(){
// function implementation details omitted for brevity
}
//In the controller (abbreviated)
public JsonResult SaveView(IEnumerable<Detail> detail, string test)
{}
//class
public class Detail
{
// class properties definition omitted for brevity
}