title: How to Get Model Object to Javascript variable
body: <p>i have an action like below in my controller and the object of one Viewmodel class i had send as an argumnet to view. The problem is i need to get this object values in 
  javascript.</p>
  
  <pre><code>public ActionResult FillChecklist()
  {
   classOne objVM=new classone();
      objVM.List=//get list 
      objVM.Id=//someid
      objVM.List2=//secondlist
   return View(objVM);
  }
  </code></pre>
  
  <p>i had tried something like below but it does not works. i know hidden variable assign is a solution but i don't know if model class has many lists then how can i get the list in javascript. </p>
  
  <pre><code>&lt;script type="text/javascript&gt;
  var obj=@Model;
  
  &lt;/script&gt;
  </code></pre>
  
  <p>i had tried the below method too. but it shows the name json is not exist in this current context</p>
  
  <pre><code>var obj = JSON.parse('@Html.Raw(Json.Encode(Model))');
  </code></pre>
  
  <p>please help me to solve this issue.</p>