In this article I will explain with an example, how to call a JSON API in ASP.Net using C# and VB.Net.
The JSON API will be called using WebClient class in ASP.Net using C# and VB.Net.
Download JSON.Net library
The JSON.Net library is available for download from the following URL.
The JSON string returned from the API
The following JSON string is returned from the ASPSnippets Test API.
      "Name":"John Hammond",
      "Country":"United States"
      "Name":"Mudassar Khan",
      "Name":"Suzanne Mathews",
      "Name":"Robert Schidner",

HTML Markup
The following HTML Markup consists of an ASP.Net GridView control.
<asp:GridView ID="GridView1" runat="server">
You will need to import the following namespaces.
using System.Net;
using System.Data;
using Newtonsoft.Json;
Imports System.Net
Imports System.Data
Imports Newtonsoft.Json
Calling JSON API in ASP.Net
Inside the Page Load event, first the JSON string is downloaded from an API using DownloadString method of the WebClient class and converted to DataTable using JSON.Net library.
Finally, the DataTable is used to populate the GridView control in ASP.Net using C# and VB.Net.
protected void Page_Load(object sender, EventArgs e)
    if (!this.IsPostBack)
        ServicePointManager.Expect100Continue = true;
        ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
        string json = (new WebClient()).DownloadString("");
        GridView1.DataSource = JsonConvert.DeserializeObject<DataTable>(json);
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
    If Not Me.IsPostBack Then
        ServicePointManager.Expect100Continue = True
        ServicePointManager.SecurityProtocol = CType(3072, SecurityProtocolType)
        Dim json As String = (New WebClient).DownloadString("")
        GridView1.DataSource = JsonConvert.DeserializeObject(Of DataTable)(json)
    End If
End Sub
ASP.Net: Call JSON API using C# and VB.Net