I am trying to send an action from another Action (separate sites) to ASP.NET MVC, and I need to publish a collection of objects. I cannot find how to serialize this collection of objects so that I can get them as a standard NameValueCollection. Example:
var test1 = new TestObject { FirstName = "John", LastName="Smith", IDNum=12345 }; var test2 = new TestObject { FirstName = "Betty", LastName="Jones", IDNum=34567}; var test3 = new TestObject { FirstName = "Bobby", LastName="Hebert", IDNum=9876 }; List<TestObject> coll; coll.Add(test1); coll.Add(test2); coll.Add(test3); WebClient wc = new WebClient(); wc.UploadData("http://mysite.com", ??? );
Any help would be greatly appreciated. Thanks in advance.
Jorin source share