View视图传json格式数据到Js

从后台返回到前端数据时,可以将所有数据转为Json格式保存。

HTML:
@using Newtonsoft.Json
<td class="hidden">@JsonConvert.SerializeObject(@item)</td>

事件将对象传入: onclick(this)
Js调用:
function onclick(objContent)
var ary = $(objContent).parents('tr:first').children('td:first');
    var jsonData = JSON.parse(arry.eq(0), text());

控制器中反序列化:

  1 Cures cure = Deserialize<Model>(Value); 

原文地址:https://www.cnblogs.com/chizhida/p/7273616.html