title: ASP.NET MVC Return Json Result?
body: <p>I'm trying to return a JSON result (array);</p>
  
  <p>If I do it manually it works</p>
  
  <pre><code>    resources:[
  {
      name: 'Resource 1',
      id: 1,
      color:'red'
  },{
      name: 'Resource 2',
      id: 2
  }],
  </code></pre>
  
  <p>but I'm having issues rendering by passing it in:</p>
  
  <p>On the view:</p>
  
  <pre><code> resources:@Model.Resources
  </code></pre>
  
  <p>Which on the controller</p>
  
  <pre><code>public ActionResult Index()
          {
  ...
  var model = new Display();
  model.Resources = GetResources();
  }
   public JsonResult GetResources()
          {
              var model = new Models.ScheduledResource()
                  {
                      id = "1",
                      name = "Resource"
                  };
              return new JsonResult() { Data = model, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
          }
  </code></pre>
  
  <p>on the model</p>
  
  <pre><code>public JsonResult Resources { get; set; }
  </code></pre>
  
  <p>But looking at whats rendered in HTML:</p>
  
  <pre><code>resources:System.Web.Mvc.JsonResult
  </code></pre>
  
  <p>Any ideas where I'm going wrong?</p>