Hi merictokatlio...,
Check this example. Now please take its reference and correct your code.
HTML
<asp:GridView runat="server" ID="gvDetails"></asp:GridView>
Namespaces
C#
using System.Net;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
VB.Net
Imports System.Net
Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
string stRead = (new WebClient()).DownloadString("https://onyuzyonetim.eba.gov.tr/api/show/plans/weekly?startDate=2020-10-12&endDate=2020-10-17&classType=ilkokul&classLevel=1");
var jObject = JsonConvert.DeserializeObject<JObject>(stRead).Root.ToList();
List<ClassDetail> classDetails = new List<ClassDetail>();
int i = 0;
foreach (var item in jObject)
{
if (i < jObject.Count - 1)
{
ClassDetail classDetail = new ClassDetail();
classDetail.classLevel = ((JProperty)item).Value["classLevel"].ToString().Replace("\"","");
classDetail.classType = ((JProperty)item).Value["classType"].ToString().Replace("\"","");
classDetail.monday = ((JProperty)item).Value["monday"].ToString().Replace("\"","");
classDetail.monday_eba_link = ((JProperty)item).Value["monday_eba_link"].ToString().Replace("\"","");
classDetail.monday_eba_download_link = ((JProperty)item).Value["monday_eba_download_link"].ToString().Replace("\"","");
classDetail.monday_trt_link = ((JProperty)item).Value["monday_trt_link"].ToString().Replace("\"","");
classDetail.monday_subject = ((JProperty)item).Value["monday_subject"].ToString().Replace("\"","");
classDetail.tuesday = ((JProperty)item).Value["tuesday"].ToString().Replace("\"","");
classDetail.tuesday_eba_link = ((JProperty)item).Value["tuesday_eba_link"].ToString().Replace("\"","");
classDetail.tuesday_eba_download_link = ((JProperty)item).Value["tuesday_eba_download_link"].ToString().Replace("\"","");
classDetail.tuesday_trt_link = ((JProperty)item).Value["tuesday_trt_link"].ToString().Replace("\"","");
classDetail.tuesday_subject = ((JProperty)item).Value["tuesday_subject"].ToString().Replace("\"","");
classDetail.wednesday = ((JProperty)item).Value["wednesday"].ToString().Replace("\"","");
classDetail.wednesday_eba_link = ((JProperty)item).Value["wednesday_eba_link"].ToString().Replace("\"","");
classDetail.wednesday_eba_download_link = ((JProperty)item).Value["wednesday_eba_download_link"].ToString().Replace("\"","");
classDetail.wednesday_trt_link = ((JProperty)item).Value["wednesday_trt_link"].ToString().Replace("\"","");
classDetail.wednesday_subject = ((JProperty)item).Value["wednesday_subject"].ToString().Replace("\"","");
classDetail.thursday = ((JProperty)item).Value["thursday"].ToString().Replace("\"","");
classDetail.thursday_eba_link = ((JProperty)item).Value["thursday_eba_link"].ToString().Replace("\"","");
classDetail.thursday_eba_download_link = ((JProperty)item).Value["thursday_eba_download_link"].ToString().Replace("\"","");
classDetail.thursday_trt_link = ((JProperty)item).Value["thursday_trt_link"].ToString().Replace("\"","");
classDetail.thursday_subject = ((JProperty)item).Value["thursday_subject"].ToString().Replace("\"","");
classDetail.friday = ((JProperty)item).Value["friday"].ToString().Replace("\"","");
classDetail.friday_eba_link = ((JProperty)item).Value["friday_eba_link"].ToString().Replace("\"","");
classDetail.friday_eba_download_link = ((JProperty)item).Value["friday_eba_download_link"].ToString().Replace("\"","");
classDetail.friday_trt_link = ((JProperty)item).Value["friday_trt_link"].ToString().Replace("\"","");
classDetail.friday_subject = ((JProperty)item).Value["friday_subject"].ToString().Replace("\"","");
classDetails.Add(classDetail);
}
i++;
}
gvDetails.DataSource = classDetails;
gvDetails.DataBind();
}
public class ClassDetail
{
public string classLevel { get; set; }
public string classType { get; set; }
public string monday { get; set; }
public string monday_eba_link { get; set; }
public string monday_eba_download_link { get; set; }
public string monday_trt_link { get; set; }
public string monday_subject { get; set; }
public string tuesday { get; set; }
public string tuesday_eba_link { get; set; }
public string tuesday_eba_download_link { get; set; }
public string tuesday_trt_link { get; set; }
public string tuesday_subject { get; set; }
public string wednesday { get; set; }
public string wednesday_eba_link { get; set; }
public string wednesday_eba_download_link { get; set; }
public string wednesday_trt_link { get; set; }
public string wednesday_subject { get; set; }
public string thursday { get; set; }
public string thursday_eba_link { get; set; }
public string thursday_eba_download_link { get; set; }
public string thursday_trt_link { get; set; }
public string thursday_subject { get; set; }
public string friday { get; set; }
public string friday_eba_link { get; set; }
public string friday_eba_download_link { get; set; }
public string friday_trt_link { get; set; }
public string friday_subject { get; set; }
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Dim stRead As String = (New WebClient()).DownloadString("https://onyuzyonetim.eba.gov.tr/api/show/plans/weekly?startDate=2020-10-12&endDate=2020-10-17&classType=ilkokul&classLevel=1")
Dim jObject = JsonConvert.DeserializeObject(Of JObject)(stRead).Root.ToList()
Dim classDetails As List(Of ClassDetail) = New List(Of ClassDetail)()
Dim i As Integer = 0
For Each item In jObject
If i < jObject.Count - 1 Then
Dim classDetail As ClassDetail = New ClassDetail()
classDetail.classLevel = (CType(item, JProperty)).Value("classLevel").ToString().Replace("""", "")
classDetail.classType = (CType(item, JProperty)).Value("classType").ToString().Replace("""", "")
classDetail.monday = (CType(item, JProperty)).Value("monday").ToString().Replace("""", "")
classDetail.monday_eba_link = (CType(item, JProperty)).Value("monday_eba_link").ToString().Replace("""", "")
classDetail.monday_eba_download_link = (CType(item, JProperty)).Value("monday_eba_download_link").ToString().Replace("""", "")
classDetail.monday_trt_link = (CType(item, JProperty)).Value("monday_trt_link").ToString().Replace("""", "")
classDetail.monday_subject = (CType(item, JProperty)).Value("monday_subject").ToString().Replace("""", "")
classDetail.tuesday = (CType(item, JProperty)).Value("tuesday").ToString().Replace("""", "")
classDetail.tuesday_eba_link = (CType(item, JProperty)).Value("tuesday_eba_link").ToString().Replace("""", "")
classDetail.tuesday_eba_download_link = (CType(item, JProperty)).Value("tuesday_eba_download_link").ToString().Replace("""", "")
classDetail.tuesday_trt_link = (CType(item, JProperty)).Value("tuesday_trt_link").ToString().Replace("""", "")
classDetail.tuesday_subject = (CType(item, JProperty)).Value("tuesday_subject").ToString().Replace("""", "")
classDetail.wednesday = (CType(item, JProperty)).Value("wednesday").ToString().Replace("""", "")
classDetail.wednesday_eba_link = (CType(item, JProperty)).Value("wednesday_eba_link").ToString().Replace("""", "")
classDetail.wednesday_eba_download_link = (CType(item, JProperty)).Value("wednesday_eba_download_link").ToString().Replace("""", "")
classDetail.wednesday_trt_link = (CType(item, JProperty)).Value("wednesday_trt_link").ToString().Replace("""", "")
classDetail.wednesday_subject = (CType(item, JProperty)).Value("wednesday_subject").ToString().Replace("""", "")
classDetail.thursday = (CType(item, JProperty)).Value("thursday").ToString().Replace("""", "")
classDetail.thursday_eba_link = (CType(item, JProperty)).Value("thursday_eba_link").ToString().Replace("""", "")
classDetail.thursday_eba_download_link = (CType(item, JProperty)).Value("thursday_eba_download_link").ToString().Replace("""", "")
classDetail.thursday_trt_link = (CType(item, JProperty)).Value("thursday_trt_link").ToString().Replace("""", "")
classDetail.thursday_subject = (CType(item, JProperty)).Value("thursday_subject").ToString().Replace("""", "")
classDetail.friday = (CType(item, JProperty)).Value("friday").ToString().Replace("""", "")
classDetail.friday_eba_link = (CType(item, JProperty)).Value("friday_eba_link").ToString().Replace("""", "")
classDetail.friday_eba_download_link = (CType(item, JProperty)).Value("friday_eba_download_link").ToString().Replace("""", "")
classDetail.friday_trt_link = (CType(item, JProperty)).Value("friday_trt_link").ToString().Replace("""", "")
classDetail.friday_subject = (CType(item, JProperty)).Value("friday_subject").ToString().Replace("""", "")
classDetails.Add(classDetail)
End If
i += 1
Next
gvDetails.DataSource = classDetails
gvDetails.DataBind()
End Sub
Public Class ClassDetail
Public Property classLevel As String
Public Property classType As String
Public Property monday As String
Public Property monday_eba_link As String
Public Property monday_eba_download_link As String
Public Property monday_trt_link As String
Public Property monday_subject As String
Public Property tuesday As String
Public Property tuesday_eba_link As String
Public Property tuesday_eba_download_link As String
Public Property tuesday_trt_link As String
Public Property tuesday_subject As String
Public Property wednesday As String
Public Property wednesday_eba_link As String
Public Property wednesday_eba_download_link As String
Public Property wednesday_trt_link As String
Public Property wednesday_subject As String
Public Property thursday As String
Public Property thursday_eba_link As String
Public Property thursday_eba_download_link As String
Public Property thursday_trt_link As String
Public Property thursday_subject As String
Public Property friday As String
Public Property friday_eba_link As String
Public Property friday_eba_download_link As String
Public Property friday_trt_link As String
Public Property friday_subject As String
End Class