Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Server side

SPWeb site = SPContext.Current.Web;
                SPList list = site.Lists["GridList"];
                SPListItemCollection items = list.Items;
                DataTable dt = items.GetDataTable();
                Gridnames.DataSource = dt;
                Gridnames.DataBind();

client side

function getToolInfo() {

       // var CamlQuery = "<Query><Where><Eq><FieldRef Name='Title'/><Value Type='Counter'>" + lastID + "</Value></Eq></Where></Query>";
        var CamlViewFields = "<ViewFields><FieldRef Name='Title' /><FieldRef Name='Description' /></ViewFields>";

        // this let me know that the function is getting called and passed the correct parameter value
        alert('function called and passed last ID of : ' );
        $().SPServices({
            operation: "GetListItems",
            async: false,
            listName: "GridList",
            CAMLViewFields: CamlViewFields,
            // CAMLQuery: CamlQuery,
            completefunc: function (xData, Status) {
                $(xData.responseXML).find("[nodeName='z:row']").each(function () {
                    alert($(this).attr("ows_Title"));
                    alert($(this).attr("ows_Description"));
                });
            }
        });
    }
share|improve this question

2 Answers 2

up vote 0 down vote accepted

It's really not a question of which method is "faster", but what your requirements are. There are times where one or the other method is preferable, but it really depends on the context.

share|improve this answer

I will suggest to go with server side call if there is an option and to have a better performance from the server. These calls are handled by the core libraries and client object model calls are handled by a different libraries which takes the calls in batches.

If the question is specific to performance and if there is scope for server side implementation then I strongly suggest to go with server side calling.

At times we require asynchronous calling to server and in these scenarios client object model is preferable.

Hope this helps you!!!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.