Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Runtime.Serialization;
Using System.Runtime.Serialization.Json;
Using System.Web;
Using System.Web.UI;
Using System.Web.UI.WebControls;
Namespace WebApplication13
{
DataContract and DataMember cannot be absent or serialized into list<t>
[DataContract]
public class Quickfastpage
{
[DataMember]
private int index {get; set;}
[DataMember]
private string URL {get; set;}
[DataMember]
private string PageName {get; set;}
}
public partial class WebForm2:System.Web.UI.Page
{
protected void Page_Load (object sender, EventArgs e)
{
if (!string. IsNullOrEmpty (request["_method") && request["_method"] = = "Setquickfast")
{
String pagepostdata = request["PostData"];
if (!string. IsNullOrEmpty (Pagepostdata))
{
list<quickfastpage> _test = new list<quickfastpage> ();
DataContractJsonSerializer _json = new DataContractJsonSerializer (_test.gettype ());
byte[] _using = System.Text.Encoding.UTF8.GetBytes (Pagepostdata);
System.IO.MemoryStream _memorystream = new System.IO.MemoryStream (_using);
_memorystream.position = 0;
_test = (list<quickfastpage>) _json.readobject (_memorystream);
}
}
}
}
}
JSON array in foreground converted to list<t> collection