如何将json返回的数据绑定到asp.net中的jquery gridview? [英] how to bind the data returned by json to jquery gridview in asp.net?

查看:106
本文介绍了如何将json返回的数据绑定到asp.net中的jquery gridview?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将json对象d返回的数据绑定到jquery网格?我尝试过使用asp.net gridview但是失败了。我已经看到了jquery网格的一些链接但我的aspx中没有可用的源代码这就是我所做的:



 function get(strcode ){

$ .ajax({
type:POST,
url:Default.aspx / MyMethod,
data:{'Code' :'+ strcode +'},
contentType:application / json; charset = utf-8,
dataType:json,
success:function(result){
//这里我想将gridview绑定到d
//中包含的值,d中的值也是动态的,意味着我从数据表中获取它们
}
} );
}



谢谢。我对jqgrid也很困惑。是jqgrid是免费的,jqgrid是客户端还是服务器端?

解决方案

.ajax({
type:POST,
url :Default.aspx / MyMethod,
data:{'Code':'+ strcode +'},
contentType:application / json; charset = utf-8,
dataType:json,
成功:函数(结果){
//这里我想将gridview绑定到d
中包含的值//也是d中的值是动态意味着我从数据表中获取它们
}
});
}



谢谢。我对jqgrid也很困惑。是jqgrid是免费的,jqgrid是客户端还是服务器端?


http://www.aspsnippets.com/Articles/Bind-data-to-GridView-with-jQuery-or-JSON-in-ASPNet.aspx


有一篇很好的CP文章,你可以参考。



在ASP.NET中使用JqGrid [ ^ ]



希望这可以帮助你..

How can i bind the data returned by json object d to jquery grid ? I have tried using asp.net gridview but failed. I have seen some links of jquery grid but no source code is available in my aspx this is what i have done:

function get(strcode) {

    $.ajax({
        type: "POST",
        url: "Default.aspx/MyMethod",
        data: "{'Code':'" + strcode + "'}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (result) {
            // Here i want to bind the gridview to the values contained in d
            //also the values in d are dynamic means i am getting them from the datatable
        }
    });
}


Thank you. also i have very confusion regarding jqgrid. is jqgrid is free and is jqgrid is client side or server side?

解决方案

.ajax({ type: "POST", url: "Default.aspx/MyMethod", data: "{'Code':'" + strcode + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (result) { // Here i want to bind the gridview to the values contained in d //also the values in d are dynamic means i am getting them from the datatable } }); }


Thank you. also i have very confusion regarding jqgrid. is jqgrid is free and is jqgrid is client side or server side?


http://www.aspsnippets.com/Articles/Bind-data-to-GridView-with-jQuery-or-JSON-in-ASPNet.aspx


There is a nice CP article which you can refer.

Using JqGrid in ASP.NET[^]

Hope this helps you...


这篇关于如何将json返回的数据绑定到asp.net中的jquery gridview?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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