jquery - How to build C# object from a FormCollection with complex keys -


I have a javascript object, obj , which passes an MVC action through $ The post () follows:

  var obj = {items: [{text: "", value: {property1: "", Property2: ""}, {text: "", Value: {property1: "", property 2: ""}}}} $ Post ('myaction', obje, function () {});  

Action signature looks like this:

  Public Action Result Mayection {}  

I need to be able to create an object from FormCollection , although I'm running on an issue where the key is in the form:

  "items [ 0] ["item [0] [value] [property1]" item [0] [value] [property 2] "" item [1] [text] "item [1] [value] [property1]" " Item [1] [value] [editorial 2] " 

I think That is, if there is a clear way to create the desired C # object from the given formCollection , I understand that I change the action management signature for the type of object I am interested in. I was presenting my own issues.

If you change to Javascript If you are sending in a JSSN version of the data, then I suppose You can either accept the string or JSAR disassembly in the controller or

  • Do a model binder to do this.

    Comments