title: Passing a DataTable object in Javascript to controller
body: <p>I have in an *.aspx page, a call to a javascript function (defined elsewhere) that takes in an <code>object</code> as as parameter... </p>
  
  <p><em>myPage.aspx</em></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      BuildTable("Results/TableList/", "TableTitle",  {&lt;%: Model.DataTable%&gt;});
      refreshTable(sortTable["tbl-div_id"]);
  &lt;/script&gt;
  </code></pre>
  
  <p><em>scripts.js</em></p>
  
  <pre><code>//global
  var sortTable = {};
  
  function BuildTable(url, title, args)
  {
     var myTable = new Object();
     myTable.postBackUrl = url;
     myTable.Title = title;
     myTable.args = (args != undefined) ? args : new Object();
     sortTable[&lt;index&gt;] = myTable;
   }
  
   function sortTable(selectedTable)
   {
      $.ajax({
          url: selectedtable.postBackUrl,
          data: selectedtable.args,
          sucess: function.....
          });
    }
  </code></pre>
  
  <p><em>postBackUrl - in Controller</em></p>
  
  <pre><code>[Authorize]
   public ActionResult TableList,&lt;params&gt;, DataTable values)
   {
       ...
       //`values` comes back a new object, there are no colmns defined, 
   }
  </code></pre>
  
  <p>I can see in <code>myPage.aspx</code> there are columns and rows defined for <code>&lt;%:Model.DataTable%&gt;</code> but as soon I go into javascript debuger, i can't recognize the object. </p>
  
  <p><strong>QUESTION</strong></p>
  
  <p>How Can I make sure the aspx page sends the entire DataTable object to the javascript and the javascript back to the server Controller so that I can then manipulate values?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>If there's a way to go directly to the controller from the View, I'm open to that too</p>