Sending an array of complex objects in the get string in C# ASP.NET MVC -
i want send array of objects in request string. know isn't optimal solution, want , running.
if have class, this
public class data { public int { get; set; } public int b { get; set; } } public class requestviewdata { public ilist<data> mydata { get; set; } }
i thought bind mvc route web request this
http://localhost:8080/request?mydata[0].a=1&mydata[0].b=2&mydata[1].a=3&mydata[1].b=4
but create array of 2 data objects without populating values 1,2, 3 or 4.
is there way bind complex objects arrays?
assuming have implemented method getarraytest in homecontroller
public class homecontroller { public actionresult getarraytest (list<data> data) }
the following work.
Comments
Post a Comment