You can do like this
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.Web.Script.Serialization;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
WebClient wb = new WebClient();
//Place your php url here
string s = wb.DownloadString("http://jsonplaceholder.typicode.com/posts");
JavaScriptSerializer serializer = new JavaScriptSerializer();
List<RootObject> records = serializer.Deserialize<List<RootObject>>(s);
GridView1.DataSource = records;
GridView1.DataBind();
}
//generate classes using json to c#
public class RootObject
{
public int userId { get; set; }
public int id { get; set; }
public string title { get; set; }
public string body { get; set; }
}
}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server"></asp:GridView>
</div>
</form>
</body>
</html>
Try you will get the result