Web Grid, Client side Binding VS. Server side HTML generation

流过昼夜 提交于 2020-01-04 15:59:02

问题


I'm working on replacing an existing web grid in an ASP.NET web application, with a new implementation. The existing grid is powerful, but not flexible enough. It also brings with it all kind of frameworks we don't like to have on our web pages.

While looking into existing options I noticed I can break the available solutions into two main approaches. The older approach is represented best by the ASP.NET GridView. This is a classic ASP.NET control that generates the needed HTML on the server, based on a given set of data. The newer approach is depending on client side rendering, mainly with jQuery. A good example would be jqGrid. Only the data is sent to the client (Usually with JSON or XML)

In the GridView case, if I want an AJAX behavior, I would have to implement it with something like an update panel.

  • Is there a definitive choice I should make?
  • Is there a good chance of achieving the same snappy behavior I get with jqGrid (even with many records), with server side rendered controls?
  • Is there some hybrid implementation incorporating both approaches?

回答1:


  1. There is no definitive choice you should make, but it's worth noting that changing to client-side AJAX controls is a pretty big paradigm shift that will require you to rethink how you do nearly everything with the grid.

  2. Going half-way (by using a server-side control such as GridView in an UpdatePanel) will likely improve the user experience, since the page will still be visible and responsive while it's updating. But the UpdatePanel-style is still clunky compared to the new client-only grids, because this technique sends all the page's form data when it posts back (including all that ViewState in the GridView, if ViewState is turned on). One brief note of caution: GridView is not compatible with UpdatePanel when GridView.EnableSortingAndPagingCallbacks is set to true.

  3. I haven't used any of they hybrid implementations (such as Coolite's Ext wrappers for .NET), but they are out there. There was at least one good SO discussion about this topic and the different grids available here.




回答2:


I am also evaluating jgGrid vs. Gridview. I am just interested in the performance and efficiency of the grid. Even though jqGrid has a bit learning curve, I can invest some time in learning if it can provide great improvement in performance when compared to gridview. Can any expert throw more light on this topic?. Thank you very much.



来源:https://stackoverflow.com/questions/1127459/web-grid-client-side-binding-vs-server-side-html-generation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!