asp.net 中使用jquery如何访问数据库,连接字符串是写在web.config中的...现在使用jquery中的easyui访问数据库,如何和后台数据进行交互啊???最好有代码例子,谢谢!

解决方案 »

  1.   

    jquery不能访问数据库,jquery的ajax可以无刷新访问其他页面. 其他页面可以访问数据库.
      

  2.   

    jquery是js的框架,跟连数据库有半毛钱关系?
      

  3.   

    $.ajax({
                    type: "GET",
                    url: "a.aspx",
                    data: "id=" + ID,
                    beforeSend: function() {
                        $("div#ProgressDiv").css("display", "block");
                    },
      

  4.   

    我的意思是想easyui这样的插件,如何从数据库中调出数据进行展示.
      

  5.   


     //页面加载时列出订单中的商品
    function Onloadtmepproducts()
    {
        $("#litCountPrice").val(0);
         $.ajax({
                url: 'preOrder.ashx',
                type: 'GET',
                dataType: "json",
                data: { bid:0},
                cache: false,
                success: function(data) {
                    GetTablelist(data);
                },
                error:function(data,status,e)
                {
                    alert("数据加载失败,请重新登录");
                    location.href="buyer_PreordersItem.html";
                }
            });
    }    
      

  6.   

    preOrder.ashx--要动态在后台生成吗?
      

  7.   

    在ajax方法中指定的url(例如5楼中的preOrder.ashx)中访问数据库,查出来的结果包装成json对象返回出来(用response.write(json数据);response.end();),然后success中的data参数能够获取返回过来的json数据。