问题
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:
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.
Going half-way (by using a server-side control such as
GridView
in anUpdatePanel
) will likely improve the user experience, since the page will still be visible and responsive while it's updating. But theUpdatePanel
-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 theGridView
, if ViewState is turned on). One brief note of caution:GridView
is not compatible withUpdatePanel
whenGridView.EnableSortingAndPagingCallbacks
is set to true.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