title: How to traverse a Dictionary that is returned from JsonResult method?
body: <p>I have a JavaScript Method that makes an AJAX call to a controller method. 
  This controller method is a JsonResult Method that returns a dictionary object back to my JavaScript. But anything I do to this object (like, dictionaryObject.count, dictionaryObejct[i].value etc.) gives me "undefined". Any idea as to how I should use this object? </p>
  
  <pre><code>function MakeControllerMethodCallFunction(stringParam1, stringParam2) {
      // Remove all rows from table so that table can have latest data
      $('#TableModal tr').each(function (i, row) {
          var $row = $(row);
  
          $row.remove();
      });
  
      $("#TableModal thead").append("&lt;tr&gt;&lt;th&gt;" + stringParam1+ " Details " + "&lt;/th&gt;&lt;/tr&gt;");
  
      //Resolving the server side method URL
      var websitePath = GetRootWebSitePath();
      var getUrl = websitePath + "/Home/GetDetails";
  
      //Creating parameters for Ajax call
      var params = "{\"ParamOne\" : \"" + stringParam1+ "\" , \"ParamTwo\" : \"" + stringParam2+ "\" }";
  
      //AJAX Call
      $.ajax({
          url: getUrl,
          type: 'POST',
          dataType: 'json',
          contentType: 'application/json; charset=utf-8',
          data: params,
          success: MakeControllerMethodCallFunction_Success,
          error: function (xhr, status, thrownError) {
              alert("Get Details error");
          }
      });
  }
  
  //On Success of MakeControllerMethodCallFunction() this will be hit and values will be bind to the table
  function MakeControllerMethodCallFunction_Success(dictionaryObject) {
      var Size = 0;
      if (dictionaryObject!= null) {
  
          Size = (dictionaryObject!= null) ? dictionaryObject.count : 0;
      }
  
      if (Size != null) {
  
          for (var i = 0; i &lt; Size; i++) {
  
              var newRow = "&lt;tr&gt;";
  
              if (dictionaryObject!= null &amp;&amp; dictionaryObject.count&gt; 0 &amp;&amp; dictionaryObject[i] != null) {
                  newRow += "&lt;td&gt;" + dictionaryObject[i].name + "&lt;/td&gt;" + "&lt;td&gt;" + dictionaryObject[i].value + "&lt;/td&gt;";
  
              }
              else {
                  newRow += "&lt;td&gt;&lt;/td&gt;";
              }
              newRow += "&lt;/tr&gt;";
              $("#TableModal tbody").append(newRow);
          }
      }
  }
  </code></pre>