Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Both samples use JSON, which you get for free when you use .NET Web Services. So the amount of data which goes over the wire will be the same.
On the client-side, don’t know about about the client-side performance of the library generated by ScriptServiceAttribute, but the differences between doing it yourself and using that library should probably be marginal.
The Ecnosia example uses jTemplates. jTemplates can give you a good boost in performance when it comes to fetching large lists and displaying them in repeating sections (like html tables).
reply to devmania:
Scott’s version applies the template server-side, and then sends html+data formatted to the client. The html here can be a real overhead (in case of a table, think about all the tr’s, td’s, style properties, spacing between tags…).
jTemplates renders client-side. The data is send in the more data efficient and compact JSON format (just the data, not the html). The template that jTemplates has to read is also much smaller, as it only contains the definitions for first row.
Yes, it is much easier to render server-side. Server-side can also be more flexible in rendering, as you can access data sources which you don’t have on the client-side.
Client-side can in many cases be more efficient. Further, with some javascript, you can make it as flexible as server-side rendering. But, I reckon complex client-side rendering would take more time to develop.