如何在asp.net中使用json绑定treeview - MVC c#? [英] how to bind treeview using json in asp.net - MVC c# ?

查看:117
本文介绍了如何在asp.net中使用json绑定treeview - MVC c#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,

我必须显示嵌套数据列表。它可以是一种树形视图



其中父节点是出版物,子节点是文章。



我的问题是我们需要使用Json对象传递所有数据,并且只在一个请求中传递。



有谁能告诉我如何使用Json绑定treeview?









PS





我的问题是我在json对象中获取数据但是在控制台中出现了一些解析器错误?



语法错误:JSON.parse:预期','或'}'



这个错误我们是得到。


i have to show a list of Nested data. it can be kind of a tree view

where parent node would be publications and child node would be articles.

my issue is we need to pass all the data using Json object and only in one request.

can anyone please let me know how to bind treeview using Json ?




P.S.


my issue is i get the data in the json object but get some parser error in console ?

SyntaxError: JSON.parse: expected ',' or '}'

this error we are getting.

推荐答案

JSON结果中可能有一些双引号,例如

{EmpName:abcd}它应该是{EmpName:abc \d}

即使用转义序列。

如果不是这样,发布你的json结果以便我们分析
There might be some double quotes within in JSON result something like
{"EmpName":"abc"d"}. It should be {"EmpName":"abc\"d"}
i.e use escape sequence.
if this is not the case, post your json result so that we can analyse


这篇关于如何在asp.net中使用json绑定treeview - MVC c#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆