title: javascript object System.Collections.Generic.List`1[System.String]?
body: <p>In MVC, is it possible to pass an array of string <code>(List&lt;string&gt;)</code> from C# code to viewdata and then retrieve the value in the view? e.g:</p>
  
  <p><em><strong>C#:</em></strong></p>
  
  <pre><code>List&lt;string&gt; names = new List&lt;string&gt;();
  names.Add("a");
  names.Add("b");
  ViewData["names"] = names;
  </code></pre>
  
  <p><em><strong>MVC view:</em></strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var nameList = '&lt;%= ViewData["names"] %&gt;';
  &lt;/script&gt;
  </code></pre>
  
  <p>the code above runs OK but the returned javascript object in the view is "System.Collections.Generic.List`1[System.String]" which cannot be parsed to get the values out.</p>
  
  <p>What is the right way to achieve that rather than build the string with delimiter in C# and split the value in the view?</p>
  
  <p>Thanks!</p>