Refer below code.
HTML
<asp:GridView runat="server" ID="gvDetails"></asp:GridView>
<table>
<tr>
<td>ChallanNo:<asp:TextBox runat="server" ID="txtChallanNo" /></td>
</tr>
<tr>
<td>TruckNo:<asp:TextBox runat="server" ID="txtTruckNo" /></td>
</tr>
<tr>
<td>Lrdate:<asp:TextBox runat="server" ID="txtLrdate" /></td>
</tr>
</table>
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
string result = System.IO.File.ReadAllText(Server.MapPath("~/json.json"));
string array = ((Newtonsoft.Json.Linq.JToken)Newtonsoft.Json.JsonConvert.DeserializeObject(result)).Root["data"].ToArray()[0].ToString();
data[] data = Newtonsoft.Json.JsonConvert.DeserializeObject<data[]>(array);
this.gvDetails.DataSource = data[0].ChallanEntries;
this.gvDetails.DataBind();
txtChallanNo.Text = data[0].ChallanNo;
txtTruckNo.Text = data[0].TruckNo;
txtLrdate.Text = data[0].Lrdate.ToString("dd/MM/yyyy");
}
public class data
{
public int Id { get; set; }
public string FromBranchCode { get; set; }
public string ChallanNo { get; set; }
public DateTime Lrdate { get; set; }
public string RoyaltyPassNo { get; set; }
public string VehicleNo { get; set; }
public string TruckNo { get; set; }
public string Total { get; set; }
public string ToBranchCode { get; set; }
public string ToBranchName { get; set; }
public string Station { get; set; }
public string Package { get; set; }
public double Freight { get; set; }
public string CompanyName { get; set; }
public string CustFullName { get; set; }
public string BranchName { get; set; }
public string ConsignorName { get; set; }
public string ConsigneeName { get; set; }
public DateTime RecieveDate { get; set; }
public DateTime DeliveryDate { get; set; }
public DateTime AuditedDate { get; set; }
public string Status { get; set; }
public string AdminName { get; set; }
public string GrossWeight { get; set; }
public string CNType { get; set; }
public string GodownName { get; set; }
public string PODFileName { get; set; }
public string UserType { get; set; }
public string DelPersonName { get; set; }
public string MrNo { get; set; }
public string IsClosingEntry { get; set; }
public string BookingTerms { get; set; }
public string CrossingVehicle { get; set; }
public string PartyInvoiceNo { get; set; }
public List<ChallanEntries> ChallanEntries { get; set; }
public string MachineQty { get; set; }
public string StationAddress { get; set; }
public string FromStation { get; set; }
public string PrivateMarkSingle { get; set; }
public string LRCarrierType { get; set; }
public string TrackingDetail { get; set; }
public string Dscc_ApprovalByText { get; set; }
}
public class ChallanEntries
{
public string BranchCode { get; set; }
public string ChallanNo { get; set; }
public string BranchName { get; set; }
public DateTime ChallaDate { get; set; }
public string Station { get; set; }
public string ChlType { get; set; }
public string Rate { get; set; }
public string TotalWeight { get; set; }
public string VehNo { get; set; }
public string Frieght { get; set; }
public string BrokerName { get; set; }
public double Total { get; set; }
public string Balance { get; set; }
public DateTime TransitDate { get; set; }
public string TotalPkgs { get; set; }
public string CarrierType { get; set; }
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Dim result As String = IO.File.ReadAllText(Server.MapPath("~/json.json"))
Dim array As String = (CType(Newtonsoft.Json.JsonConvert.DeserializeObject(result), Newtonsoft.Json.Linq.JToken)).Root("data").ToArray()(0).ToString()
Dim data As data() = Newtonsoft.Json.JsonConvert.DeserializeObject(Of data())(array)
Me.gvDetails.DataSource = data(0).ChallanEntries
Me.gvDetails.DataBind()
txtChallanNo.Text = data(0).ChallanNo
txtTruckNo.Text = data(0).TruckNo
txtLrdate.Text = data(0).Lrdate.ToString("dd/MM/yyyy")
End Sub
Public Class data
Public Property Id As Integer
Public Property FromBranchCode As String
Public Property ChallanNo As String
Public Property Lrdate As DateTime
Public Property RoyaltyPassNo As String
Public Property VehicleNo As String
Public Property TruckNo As String
Public Property Total As String
Public Property ToBranchCode As String
Public Property ToBranchName As String
Public Property Station As String
Public Property Package As String
Public Property Freight As Double
Public Property CompanyName As String
Public Property CustFullName As String
Public Property BranchName As String
Public Property ConsignorName As String
Public Property ConsigneeName As String
Public Property RecieveDate As DateTime
Public Property DeliveryDate As DateTime
Public Property AuditedDate As DateTime
Public Property Status As String
Public Property AdminName As String
Public Property GrossWeight As String
Public Property CNType As String
Public Property GodownName As String
Public Property PODFileName As String
Public Property UserType As String
Public Property DelPersonName As String
Public Property MrNo As String
Public Property IsClosingEntry As String
Public Property BookingTerms As String
Public Property CrossingVehicle As String
Public Property PartyInvoiceNo As String
Public Property ChallanEntries As List(Of ChallanEntries)
Public Property MachineQty As String
Public Property StationAddress As String
Public Property FromStation As String
Public Property PrivateMarkSingle As String
Public Property LRCarrierType As String
Public Property TrackingDetail As String
Public Property Dscc_ApprovalByText As String
End Class
Public Class ChallanEntries
Public Property BranchCode As String
Public Property ChallanNo As String
Public Property BranchName As String
Public Property ChallaDate As DateTime
Public Property Station As String
Public Property ChlType As String
Public Property Rate As String
Public Property TotalWeight As String
Public Property VehNo As String
Public Property Frieght As String
Public Property BrokerName As String
Public Property Total As Double
Public Property Balance As String
Public Property TransitDate As DateTime
Public Property TotalPkgs As String
Public Property CarrierType As String
End Class