SharePoint 2013 CSOM in Managed code – Where is the “Current” in the Client Context!?

SharePoint 2013 CSOM in Managed code – Where is the “Current” in the Client Context!?

This was a question I posted in the SharePoint Community as I was investigating around SP APIs and came to try CSOM, to see what’s there and what not.

Just at the start of utilizing CSOM and as anyone I am trying to call “Current” property for the web application instead of writing the Web Full URL which is a very basic thing.

I looked here http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client in this Namespace: Microsoft.SharePoint.Client to find “Current” property, but found nothing.

And I looked for the namespace Microsoft.SharePoint.Client.Silverlight for Silverlight here http://msdn.microsoft.com/en-us/library/sharepoint/microsoft.sharepoint.client.clientcontext.aspx and it does have the “Current” property.

And view the DLL in Object Browser, there you go;

Does this mean only for Silverlight web parts or what exactly?

And in JSOM JavaScript Object model, there is a "Current" function: SP.ClientContext.get_current()

While and of course everyone knows this in the .NET Server API it exists http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spcontext.aspx

Example:

SPList oListCur = SPContext.Current.List;

SPWeb oWeb = SPContext.Current.Web;

SPSite oSite = SPContext.Current.Site;

SPWebApplication oWebApplicationCur = SPContext.Current.Site.WebApplication;

So my question to confirm with anyone was... is "Current" property really doesn't exist in CSOM in managed code!?

Below was the reply; I am not going to write it but rather took screen shot to read it as is; but I highlighted the important parts where he confirms it doesn’t exist in CSOM, then he explains the reason, deep dive details in the background where everyone needs to understand..

And here is the link to this discussion in SharePoint Community.

Leave a Comment
  • Please add 3 and 2 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
Page 1 of 1 (2 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
Page 1 of 1 (4 items)