代码很简单,就是模仿easyui官网上的例子在asp.net中实现,然而在用html中数据显示正常,移植到.net中,数据无法显示,代码如下:
<table id="tt" class="easyui-datagrid" style="width:700px;height:350px"
data-options="url:'datagrid_data.json',fitColumns:true,singleSelect:true"
title="数据"
rownumbers="true" pagination = "true">
<thead>
<tr>
<th data-options="field:'code',width:100">代码</th>
<th data-options="field:'name',width:100">名字</th>
<th data-options="field:'col4',width:100">其他</th>
</tr>
</thead>
</table>
在百度上查找不到相关解决方法,最终在google上找到类似的问题,最终将json文件扩展名改成.aspx就可以读取了。
本文介绍了一个在ASP.NET环境下使用EasyUI组件显示数据时遇到的问题及解决方案。作者发现同样的代码在HTML中可以正常显示数据,在.NET环境中却无法显示。通过更改json数据源的扩展名为.aspx,成功解决了数据加载问题。
5596

被折叠的 条评论
为什么被折叠?



