title: Output JSON value in ASP.NET MVC
body: <p>I´m trying to get single value out of an object array and display it for now inside paragraph tag on my index page.</p>
  
  <p>In my HomeController I have done this</p>
  
  <pre><code>public ActionResult Index()
      {
  
          WebClient client2 = new WebClient();
          Stream stream = client2.OpenRead("http://localhost/ARN/weatherAPI.json");
          StreamReader reader = new StreamReader(stream);
  
          Newtonsoft.Json.Linq.JObject jObject = Newtonsoft.Json.Linq.JObject.Parse(reader.ReadLine());
          // instead of WriteLine, 2 or 3 lines of code here using WebClient to download the file
          var weatherString = (string)jObject["weather"][0]["main"];
          stream.Close();
  return View();
  </code></pre>
  
  <p>I started by creating a new project in Console Application to test it and I ran this lines of code but used <code>Console.Writeline(weatherString)</code> and it gave me exactly the value I needed in the console but now I'm facing the problem to try to show it on the index page with the ASP.NET MVC</p>
  
  <p>Since this piece of code is in my HomeController and my Index.cshtml is elsewhere, is there an easy way for me to output the <code>weatherString</code> variable as an simple text on my index page?</p>
  
  <p>The JSON looks like this:</p>
  
  <pre><code>     "weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}]
  </code></pre>
  
  <p>So I wan't "Rain" to be outputted on my webpage.</p>