I have a controller method like this:
[GET]
public ActionResult GetFailureInfo(List<FailureInfoModel> failureInfoModels){}
And I have a model like this:
public class FailureInfoModel {
public int Id {get; set;}
public List<string> Reasons {get; set;}
}
Now I would like to pass json data by using window.open() in frontend like this:
<script type="text/javascript">
var json =
[
{
Id:111,
Reasons:[1,2]
}
];
var formatJson = JSON.stringify({failureInfoModels : json});
window.open("url?failureInfoModels=" + escape(formatJson))
</script>
But there can only get a object of List with 0 items. How should I change my code to work this out? Thanks.