title: Passing Json from action to view by ViewBag
body: <p>I'm trying to get the result below using <code>JsonResult</code>, but I can't </p>
  
  <pre><code>var localJSON = [
  
              { "id": "1", "label": "tagName1", "value": "tagValue1" },
                  { "id": "2", "label": "tagName2", "value": "tagValue2" },
                  { "id": "3", "label": "tagName3", "value": "tagValue3" },
                  { "id": "1553", "label": "tagName1553", "value": "tagValue1553" }
      ];
  </code></pre>
  
  <p>Here is the way I use:</p>
  
  <p><strong>controller</strong></p>
  
  <pre><code>private JsonResult GetAvailableTags()
          {
              var tagsList = Facade.Tags.Get(CurrentLocale.ID);
              var retValue = new
              {
                  id = tagsList.Select(x =&gt; x.ID).ToArray(),
                  label = tagsList.Select(x =&gt; x.Name).ToArray(),
                  value = tagsList.Select(x =&gt; x.Name).ToArray()
              };
              return Json(retValue);
          }
  public ActionResult AddPhoto()
          {
  
              var availblableTags = GetAvailableTags();
              JavaScriptSerializer serializer = new JavaScriptSerializer();
              ViewBag.AvailableTags = serializer.Serialize(availblableTags.Data);
              return View();
          }
  </code></pre>
  
  <p><strong>view</strong></p>
  
  <pre><code>var localJSON = [ @Html.Raw(ViewBag.AvailableTags)];
  </code></pre>
  
  <p>The result is </p>
  
  <pre><code>var localJSON = [
     {"id":[1,2,3,1553],"label":["tagName1","tagName2","tagName3","tagName1553" ],"value":["tagName1","tagName2","tagName3","tagName1553" ]}
          ];
  </code></pre>
  
  <p>What should I do to resolve that?</p>