Hi ramco1917,
Please refer below sample.
Json
{
"status": true,
"data": {
"id": "16621681",
"order_id": "29920015",
"order_number": "890",
"created": "2022-12-26",
"awb_number": "14189990126365",
"rto_awb": "",
"courier_id": "3",
"warehouse_id": "132002",
"c": "132002",
"status": "cancelled",
"rto_status": "",
"shipment_info": "",
"history": [
{
"status_code": "PP",
"location": "CAR\/HUB, Chandigarh, CHANDIGARH",
"event_time": "2022-12-26 19:37",
"message": "Pickup Not Done"
},
{
"status_code": "PP",
"location": "CAR\/HUB, Chandigarh, CHANDIGARH",
"event_time": "2022-12-26 12:10",
"message": "Out for Pickup"
},
{
"status_code": "PP",
"location": "CAR\/HUB, Chandigarh, CHANDIGARH",
"event_time": "2022-12-26 11:17",
"message": "Pending"
}
]
}
}
HTML
<asp:Repeater ID="rptData" runat="server">
<HeaderTemplate>
<table>
<tr>
<td>id</td>
<td>order_id</td>
<td>order_number</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:Label ID="lblId" runat="server" Text='<%# Eval ("id") %>'></asp:Label></td>
<td><asp:Label ID="lblOrder_id" runat="server" Text='<%# Eval ("order_id") %>'></asp:Label></td>
<td><asp:Label ID="lblOrder_number" runat="server" Text='<%# Eval ("order_number") %>'></asp:Label></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
Namespaces
C#
using System.IO;
using System.Web.Script.Serialization;
VB.Net
Imports System.IO
Imports System.Web.Script.Serialization
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
string json = File.ReadAllText(Server.MapPath("~/json.json"));
JavaScriptSerializer serializer = new JavaScriptSerializer();
Root root = serializer.Deserialize<Root>(json);
List<Data> data = new List<Data>();
data.Add(root.data);
rptData.DataSource = data;
rptData.DataBind();
}
public class Data
{
public string id { get; set; }
public string order_id { get; set; }
public string order_number { get; set; }
public string created { get; set; }
public string awb_number { get; set; }
public string rto_awb { get; set; }
public string courier_id { get; set; }
public string warehouse_id { get; set; }
public string rto_warehouse_id { get; set; }
public string status { get; set; }
public string rto_status { get; set; }
public string shipment_info { get; set; }
public List<History> history { get; set; }
}
public class History
{
public string status_code { get; set; }
public string location { get; set; }
public string event_time { get; set; }
public string message { get; set; }
}
public class Root
{
public bool status { get; set; }
public Data data { get; set; }
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Dim json As String = File.ReadAllText(Server.MapPath("~/json.json"))
Dim serializer As JavaScriptSerializer = New JavaScriptSerializer()
Dim root As Root = serializer.Deserialize(Of Root)(json)
Dim data As List(Of Data) = New List(Of Data)()
data.Add(root.data)
rptData.DataSource = data
rptData.DataBind()
End Sub
Public Class Data
Public Property id As String
Public Property order_id As String
Public Property order_number As String
Public Property created As String
Public Property awb_number As String
Public Property rto_awb As String
Public Property courier_id As String
Public Property warehouse_id As String
Public Property rto_warehouse_id As String
Public Property status As String
Public Property rto_status As String
Public Property shipment_info As String
Public Property history As List(Of History)
End Class
Public Class History
Public Property status_code As String
Public Property location As String
Public Property event_time As String
Public Property message As String
End Class
Public Class Root
Public Property status As Boolean
Public Property data As Data
End Class
Screenshot