I have a name value pair array in Javascript (just like form.SerializeArray()) which i want to pass to my controller and receive it as a list of dictionary objects.
is it possible ? If so how do i pass the object ?
Thanks
EDIT
Here is my JS object which i want to pass
var ct = $('#frmrpt').serializeArray();
url="MyController/Print";
var vhtml = "<iframe src=" + url + " style='width: 100%; height: 100%' ></iframe>";
$('#repo').html(vhtml);
And Here is how i want to receive it at the controller
public ActionResult Print( List<Dictionary<string, object>> prms)
I use something like below to deserialize json strings
public static T DeserializeJSON<T>(string jsonData)
{
if (!string.IsNullOrEmpty(jsonData))
{
//jsonData = jsonData.Replace('"', ' ');
var serializer = new JavaScriptSerializer();
return serializer.Deserialize<T>(jsonData);
}
return default(T);
}
You can use json.net to deserialize your collection.
Controller:
client: