如何更新与webMethods的数据网格 [英] How to update an datagrid with webmethods
问题描述
我选择的方法来更新我的数据每秒通过一段JavaScript PageMethod的和的WebMethod。
I choose the method to update my data every second with a javascript PageMethod and WebMethod.
使用通过对象我可以设置标签hunderts如果是naeccasery得多的回报。
With much returns via an object I can set hunderts of labels if it is naeccasery.
2 completedatabase-querys的时间是温特200毫秒和后重量为wunderfull低!
The time for 2 completedatabase-querys is unter 200 Milliseconds and the Post-Weight is wunderfull low!
但我怎么能数据绑定的GridView我在一个WebMethod?
But how I can databind my gridview in a webmethod?
有没有绑定在JavaScript中的我怎么能以静态方法访问它的方式?
Is there a way to bind it in JavaScript of how can I access it with a static method?
推荐答案
您可以绝对使用AJAX和Web服务在ASP.NET应用程序中显示表格数据(网格)。这些计算器的问题提供了一个很好的介绍几种不同的选择:
You can absolutely use AJAX and web services to display tabular data (grids) in your ASP.NET applications. These StackOverflow questions offer a good introduction to several different options:
- Web Grid, Client side Binding VS. Server side HTML generation
- JQuery GridView control
但是,你不能随便数据绑定 GridView控件
或的 的DataGrid
在JavaScript功能的控制。网格控件是服务器端对象,深深融入 ASP.NET页面生命周期。
However, you cannot literally databind GridView
or DataGrid
controls in javascript functions. The grid controls are server-side objects, deeply integrated into the ASP.NET page lifecycle.
ASP.NET只能控制在页
实例存在 - 并且静态的WebMethods的执行过程中没有创建的页面实例。对于这很好的解释,看到的为什么ASP.NET AJAX页面方法必须是静态的?
ASP.NET controls only exist inside Page
instances - and no page instance is created during the execution of static WebMethods. For a great explanation of this, see Why do ASP.NET AJAX page methods have to be static?
这篇关于如何更新与webMethods的数据网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!