Contents
Gets the website that is associated with the client context. Use the ClientContext object to return context information about the current web application, site, site collection, or server version. The following code example creates an instance of the client context object, which is used to access the SharePoint object model.
What do I need to know about objectcontextoptions?
Gets the ObjectContextOptions instance that contains options that affect the behavior of the ObjectContext. Gets or sets the default container name. Gets the metadata workspace used by the object context. Gets the object state manager used by the object context to track object changes.
What does the clientcontext object do in SP?
Disposes of the context. Executes the current pending request asynchronously on the server. Retrieves the properties of a client object from the server. Retrieves an enumerable sequence of child client objects from the specified collection. Raises the ExecutingWebRequest event.
Which is an instance of the ObjectContext class?
An instance of the ObjectContext class encapsulates the following: A connection to the database, in the form of an EntityConnection object. Metadata that describes the model, in the form of a MetadataWorkspace object.
Initializes a new instance of the ClientContext object for the specified SharePoint site. The ClientContext object has the following methods. Casts the specified client object to a derived type. Disposes of the context. Executes the current pending request asynchronously on the server.
How to get the current context from sp.clientcontext?
The example gets the current context by using the current property. var clientContext; var website; // Make sure the SharePoint script file ‘sp.js’ is loaded before your // code runs.
What can I do with the clientcontext object?
Gets or sets the trace correlation ID used by the server. Gets the URL associated with the runtime context. Gets the website that is associated with the client context. Use the ClientContext object to return context information about the current web application, site, site collection, or server version.