title: How to pass json string generated on server side and use it as aparameter in javascript on client side in MVC
body: <p>Hello everyone this will be my first question!</p>
  
  <p>So basically i want to pass serialized array from server side to client side and then use it as a parameter in JS. For now im sending it as a regular string by viewModel and trying to inject it by using @Html.Raw() as below but it doesn't work:</p>
  
  <pre><code>        var table = $('#shipments').dataTable({
              "bServerSide": true,
              "sAjaxSource": "GetShipmentsAH",
              "bProcessing": true,
              "bJQueryUI": true,
              "fnCreatedRow": function (nRow, aData, iDataIndex) {
                  $(nRow).attr('shipID', aData[0]);
              },
              "aoColumns": @Html.Raw(Model.ShipmentsAoColJSon);
          });
  </code></pre>
  
  <p>This is a value of Model.ShipmentsAoColJSon:</p>
  
  <blockquote>
    <p>[{"sName":"ID","sDefaultContent":"","bSortable":true,"bSearchable":true,"sSearch":""},{"sName":"EAN","sDefaultContent":"","bSortable":true,"bSearchable":true,"sSearch":""},{"sName":"Serial","sDefaultContent":"","bSortable":true,"bSearchable":true,"sSearch":""},{"sName":"Nr","sDefaultContent":"","bSortable":true,"bSearchable":true,"sSearch":""},{"sName":"StoreUnitNr","sDefaultContent":"","bSortable":true,"bSearchable":true,"sSearch":""},{"sName":"FCode","sDefaultContent":"","bSortable":true,"bSearchable":true,"sSearch":""},{"sName":"ProdDesc","sDefaultContent":"","bSortable":true,"bSearchable":true,"sSearch":""}]</p>
  </blockquote>
  
  <p>When i just copy paste it it straight to code it works fine.
  Any ideas?</p>