what is the clientcontext Sharepoint object?

Asked

Viewed 32 times

1

I’m having a doubt, I’ve researched some places but I can’t understand what context is that the clientcontext instance class.

I am using in my code passing a URL (obviously) I know this class creates a context of the page that was passed by parameter but I would like a more technical definition, what this class does behind the scenes.

using(var clientContext = this.clienteContext("URL")) 

1 answer

0

Hello!

Clientcontext is the context where your code will run, that is, from it is where you can access the Sharepoint objects to retrieve the current site, current user, lists and Sharepoint items.

For example, to retrieve the current website from the context in which our code is running, we will use clientContext.Web. To retrieve a certain list from our portal, we will use clientContext.Web.Lists.Getbytitle("List Name")

Browser other questions tagged

You are not signed in. Login or sign up in order to post.