I will get JSON objects like below formats,each format contains differnt properties/Keys i.e. these properties/keys are dynamic.
var SelectedRows= [
{"id":"1","name":"jhon","phone":"6699"},
{"id":"2","name":"Aron","phone":"7799"},
{"id":"3","name":"Iyan","phone":"8899"},
]
var SelectedRows= [
{"id":"1","fname":"jhon","lname":"6699"},
{"id":"2","fname":"Aron","lname":"7799"},
{"id":"3","fname":"Iyan","lname":"8899"},
]
var SelectedRows= [
{"id":"1","fname":"jhon","lname":"6699"},
{"id":"2","fname":"Aron","lname":"7799"},
{"id":"3","fname":"Iyan","lname":"8899"},
]
Posting the data using AJAX post call.
$.ajax({
url: "@Url.Action("Export", "Export")",
type: "POST",
data: JSON.stringify(SelectedRows),
success: function(result) {}
});
Controller Action method:
[HttpPost]
public ActionResult Export(**what type to specify here**)
{
}
As i said properties/keys are dynamic so i can't use the strong type model here. I have to specifiy some genaric type of parameter for the action method.
I don't it is possible or not? if yes, how to do?