Return PDF to browser using JSON and MVC?

后端 未结 2 501
醉话见心
醉话见心 2021-01-13 17:59

I have a link as follows.

@Html.ActionLink(\"Create Report\", \"Screenreport\", \"Reports\", null, new { @class = \"subNavA AddBorderTop\", id = \"screenRe         


        
2条回答
  •  生来不讨喜
    2021-01-13 18:12

    I feel obligated to post my answer since I didn't hear from anyone. I ended up creating a form that includes a hidden input, then saved my json object in the hidden input and then submit the form. This time I will get input as an string not a json or xml.

    var $hidInput = $("#dataToReport"); 
    $hidInput.val(JSON.stringify(Screentable)); 
    $('#frmScreenreport').submit(); 
    

    Thanks all anyways.

提交回复
热议问题