views:

155

answers:

2

What are the pros and cons of the following 2 cases:

Case I:

Traditional way: Add service reference in project. Create object and Get data from service on server side and bind to asp.net grid.

Case II:

Update Service for JSON behavior. Add service reference in project. Call service from javascript to get data. Bind data to jquery grid.

Which one is the best approach and why?(Not developer point of view)

If there is another approach which is more optimized, please explain it and consider for large data.

+2  A: 

It depends on whether end-clients (browsers) are allowed to have access to the WCF data service, or just the app service. For simple security modes, having json allows a lot of very simply jQuery etc scenarios.

Of course, jQuery etc demands a compatible browser; these days that means "most", but by no means "all". So if you want to provide the same data to dumb browsers you'll need a way to get the data at the server.

If the intend is to provide server-to-server (B2B etc) access, json is generally a second choice; xml (SOAP etc) would be the de-facto standard, but it isn't the only option. For example, if you have high bandwidth needs you might choose a more compact binary transmission format (there are many).

Marc Gravell
Is a simple asp.net with ajaxcontroltoolkit app cross browser compatible more than jQuery?
Brij
@brz - 6 of one, half dozen of the other.
Sky Sanders
@Sky 6 of one ?
Brij
@bzr - in the context of this conversation, msajax or jquery, no difference. the point marc is making is that if you anticipate the necessity of supporting ALL browsers, including C grade and legacy versions, you might want to maintain the standard WCF channel along with your JSON channel.
Sky Sanders
A: 

second approach. any client can now consume that data, whether it'd be jquery grid or even an iphone client.

Joo Park