title: Parse JSON file in ASP.NET MVC and display the data in the webpage
body: <p>I have a remote URL from where I read a JSON Object that looks like this:</p>
  
  <pre><code>{"books":
   [
     {"title":"Book 1", "author":"Author1", "price":762, "inStock":15},
     {"title":"Book 2", "author":"Author2", "price":100, "inStock":1},
     {"title":"Book 3", "author":"Author3", "price":185.5, "inStock":5},
     {"title":"Book 4", "author":"Author 4", "price":1748, "inStock":3},
     {"title":"Book 5", "author":"Author 5", "price":999, "inStock":20},
     {"title":"Book 6", "author":"Author 6", "price":499.5, "inStock":3},
     {"title":"Book 7", "author":"Author 7", "price":564.5, "inStock":0}
   ]
  }
  </code></pre>
  
  <p>I have created two classes Book.cs</p>
  
  <pre><code>public class Book
  {
      public string title;
  
      public string author;
  
      public string price;
  
      public string inStock;
  }
  </code></pre>
  
  <p>And Books.cs</p>
  
  <pre><code>public class Books
  {
      public IList&lt;Book&gt; books { get; set; }
  }
  </code></pre>
  
  <p>How to correctly parse the JSON so I can show the contents in the Razor HTML</p>
  
  <p>This is my controller:</p>
  
  <pre><code>public ActionResult Index()
  {
      var webClient = new WebClient();
      var json = webClient.DownloadString(@"http://www.myurl.json");
      Books[] books = JsonConvert.DeserializeObject&lt;Books[]&gt;(json);
  
      return View(books);
  }
  </code></pre>