title: Best way to serialize object to JSON in ASP.NET
body: <p>I'm new in ASP.NET. I have an object tree structure and I want to use <a href="https://github.com/jonmiles/bootstrap-treeview" rel="nofollow">Bootstrap-treeview</a>. The problem is that it get json data as input. </p>
  
  <p>What is the best way to convert my List to JSON?
  Is it better to that in COntroller or better do it in View(JavaScript?)?
  Mybe there is better ways to build a tree?</p>