My C# Class
public class City
{
public int City_id { get; set; }
public string City_name { get; set; }
}
public class Model
{
public City[] lstCitiesResult { get; set; }
}
My Code:
namespace gtp2
{
....
List<Model> li = new List<Model>();
WebClient re = new WebClient();
var data = re.DownloadString("url");
var a = JsonConvert.DeserializeObject<Model>(data);
Response.Write(a.lstCitiesResult.ToString());
....
}
In Response.Write i got like this:gtp2.City[] Any Ideya?thanks in advance
It looks like the result is an array of
Cityso you need to loop through it. But you can have it displayed with a control that handles collection e.g. ListView, DataList etc. Try this: