asp.net 生成 easyUI Tree 中 json ,中间关键字问题
如下图,在 代码中 checked 本身就是关键字了。所以在里面无法直接使用的。
jsonList.Add(new { id = area.ID, text = area.AreaName, iconCls = "icon-lou", state = "closed", checked = isSelect });
找了很多资料,最后找到只需要改成 @checked 就行了,前面加 @转译为字符了。就这么简单整了好久!
jsonList.Add(new { id = area.ID, text = area.AreaName, iconCls = "icon-lou", state = "closed", @checked = isSelect }); //正确代码
算是学习了,本人刚学 .net 还希望多多指点!

浙公网安备 33010602011771号