日期:2014-05-17  浏览次数:20479 次

用GridView如何在后台绑定具有josn格式的字符串数据
我得到了一连串具有josn格式的字符串:
[{"Id":38,"Email":"pawkin@gmail.com","RealName":"李秋明","UserName":"Pawkin","ROWSTAT":""},{"Id":39,"Email":"775621338@qq.com","RealName":"","UserName":"xiaog","ROWSTAT":""},{"Id":40,"Email":"975617442@qq.com","RealName":"","UserName":"閤三华","ROWSTAT":""},{"Id":41,"Email":"ldm5202006@126.com","RealName":"李冬梅","UserName":"Only","ROWSTAT":""},{"Id":42,"Email":"cxp@jqw.com","RealName":"陈小平","UserName":"Amy","ROWSTAT":""},{"Id":44,"Email":"124571549@qq.com","RealName":"","UserName":"lin","ROWSTAT":""},{"Id":51,"Email":"345859266@qq.com","RealName":"罗春花","UserName":"luozz","ROWSTAT":""},{"Id":52,"Email":"24950568@qq.com","RealName":"","UserName":"lai","ROWSTAT":""},{"Id":53,"Email":"81166469@qq.com","RealName":"","UserName":"简单","ROWSTAT":""},{"Id":54,"Email":"727106922@qq.com","RealName":"","UserName":"luozhen1009","ROWSTAT":""}]
不知道如何用GridView去绑定这些数据,并在前台显示出来。求助各位大侠了,小女不甚感激!

------解决方案--------------------
你得解析这个大的Json字串,分行列解析完,放到一个可作为绑定源(比如DataTable)的对象里面就OK了。。。
------解决方案--------------------
你建个enriry,就包含Id,Email,RealName,UserName,ROWSTAT
然后用微软的javascriptjson那个序列化的类反序列化成Entity集合就可以啦
------解决方案--------------------
1.你可以用JsonNet做序列化;
2.你可以正则自己加到DataTable;
3.你可以自己正则反色到Model中。