I have a rather peculiar problem when trying to use the jQuery getJSON function.
I try to send my parameters by making an object like so:
var args = {
from: "",
to: "",
customerId: "52"
articles: ['12312', '21521']
};
Then call the getJSON function:
$.getJSON('/Statistics/TimeGraph', args, function (response) {
//Fill graph.
});
This is where the problem starts. I recieve the request on the controller, but articles is not populated (the other parameters are).
Controller action:
public JsonResult TimeGraph(DateTime? from, DateTime? to, int? customerId, string[] articles)
{
return Json("", JsonRequestBehavior.AllowGet);
}
Is it not possible to send an array inside an object like this? Or is there something I'm missing?