通过WCF和JQuery绑定网格 [英] Binding grid through wcf and jquery

查看:83
本文介绍了通过WCF和JQuery绑定网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何使用WCF

推荐答案

1)您需要设计一个WCF服务来查询您的SQL数据库

我不知道您对WCF有多少了解,所以这里有一篇简单的我的第一个WCF服务"类型的文章

http://www.myitblog.com/sundararajan/programming-your-first-wcf- service.html [ ^ ]

2)您需要从jQuery代码中调用WCF服务.在west-wind.com上非常不错的文章+代理源代码

http://www.west-wind.com/weblog/posts/324917.aspx [ ^ ]

3)您需要将ajax调用的结果绑定到gridview

这是在客户端而不是服务器上发生的,因此它不像服务器端数据绑定,我们只想更新显示的HTML.您可以构建自己的HTML并替换类似的内容....

jQuery(''#MyElement'').html(someBuiltHtmlString);

或者您可以在这里阅读

http://haacked.com/archive/2009/04/14/using-jquery-grid-with-asp.net-mvc.aspx [
1) You need to design a WCF service that will query your SQL database

I have no idea how much you know about WCF, so here is a simple ''my first WCF service'' type article

http://www.myitblog.com/sundararajan/programming-your-first-wcf-service.html[^]

2) You need to call the WCF service from your jQuery code. Quite a nice article + proxy source code on west-wind.com

http://www.west-wind.com/weblog/posts/324917.aspx[^]

3) You need to bind the results of your ajax call to the gridview

This happens on the client rather than the server, so it''s not like a server side databind, we just want to update the HTML displayed. You can build up your own HTML and replace something like....

jQuery(''#MyElement'').html(someBuiltHtmlString);

Or you could have a read here

http://haacked.com/archive/2009/04/14/using-jquery-grid-with-asp.net-mvc.aspx[^]


这篇关于通过WCF和JQuery绑定网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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