title: Accessing ASP.NET MVC model data from with Javascript
body: <p>I have a strongly typed View that accepts a Customer model, this customer model is a LINQ2SQL partial class that has a property called Journeys which returns all Journeys that are associated with this Customer.</p>
  
  <p>I was wondering if it would be possible to access the Customer.Journeys property as a JSON object from within the Javascript.</p>
  
  <p>Is this possible?  If so how would I go about accessing it?  Would I be best to create a FormViewModel and store the Customer details and Journey details as a JSON object there and pass it to the javascript function using something like:</p>
  
  <pre><code>&lt;% MyJavascriptFunction(Model.JSONJourneys) %&gt;
  </code></pre>
  
  <p>Or should I alter the Journeys partial class and add a .ToJson() property? Or something completely different?</p>
  
  <p>Thanks.</p>