• Know more about me

Mai Omar Desouki

~ Senior Cloud Solution Architect @ Microsoft

Mai Omar Desouki

Daily Archives: August 22, 2013

SharePoint 2013 CSOM in managed code – Where is the “Current” in the client context!?

22 Thursday Aug 2013

Posted by Mai Omar Desouki in SharePoint 2013

≈ 2 Comments


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 property “Current” for the web application instead of writing the Web Full URL which is a vvvvvv 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 nothing.

And 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 means 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 exists 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 exists 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

Share this:

  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print
  • Reddit

Like this:

Like Loading...

Blog Visitors

  • 81,558 Visitors

Categories

  • About me (1)
  • Microsoft Teams (3)
    • SharePoint Online (1)
  • Microsoft Viva (1)
  • Migration (2)
  • Parents (1)
  • Power Platform (1)
  • SharePoint 15 (5)
  • SharePoint 2010 (56)
    • Content Types (1)
    • Developer Dashboard (1)
    • Document Set (1)
    • Events I am Speaking In (2)
    • External Lists (1)
    • FAQ (2)
    • FBA (1)
    • Form Based Authentication (1)
    • Integration of CRM 2011 with SharePoint 2010 (1)
    • JQuery (1)
    • Master Page (1)
    • My Site (1)
    • PowerShell (3)
    • SharePoint Administration (5)
    • SharePoint Branding (1)
    • SharePoint Customization (5)
    • SharePoint Designer (4)
    • SharePoint Designer Workflow (1)
    • SharePoint Events (2)
    • SharePoint Online (1)
    • SharePoint Permissions (1)
    • SharePoint Workflow (1)
    • User Profile (2)
    • User Profile Sync (1)
    • Videos (1)
    • WebParts (1)
    • Workflow (1)
  • SharePoint 2013 (91)
    • Cloud App (1)
    • Event Handler (1)
    • iPad (1)
    • IPhone (1)
    • Napa (1)
  • SharePoint Updates (1)
  • Visual Studio 2012 (3)

Tag Cloud

About me Document Set Events I am Speaking In FAQ FBA Form Based Authentication JQuery Master Page Microsoft Teams Migration My Site PowerShell SharePoint 15 SharePoint 2010 SharePoint 2013 SharePoint Administration SharePoint Branding SharePoint Customization SharePoint Designer SharePoint Designer Workflow SharePoint Events SharePoint Online SharePoint Permissions SharePoint Workflow User Profile User Profile Sync Videos Visual Studio 2012 WebParts Workflow

Calendar

August 2013
M T W T F S S
 1234
567891011
12131415161718
19202122232425
262728293031  
« Jul   Sep »

Archive

  • August 2022 (2)
  • July 2022 (2)
  • March 2022 (1)
  • August 2021 (2)
  • September 2020 (2)
  • May 2020 (2)
  • April 2020 (6)
  • March 2020 (1)
  • September 2019 (2)
  • July 2015 (1)
  • May 2015 (3)
  • April 2015 (1)
  • March 2015 (1)
  • February 2015 (2)
  • January 2015 (1)
  • October 2014 (1)
  • September 2014 (3)
  • June 2014 (7)
  • May 2014 (5)
  • April 2014 (4)
  • March 2014 (3)
  • February 2014 (1)
  • January 2014 (2)
  • December 2013 (6)
  • November 2013 (5)
  • October 2013 (6)
  • September 2013 (5)
  • August 2013 (5)
  • July 2013 (5)
  • June 2013 (2)
  • May 2013 (2)
  • February 2013 (2)
  • January 2013 (1)
  • October 2012 (2)
  • September 2012 (7)
  • August 2012 (15)
  • July 2012 (5)
  • June 2012 (2)
  • May 2012 (4)
  • April 2012 (2)
  • March 2012 (1)
  • August 2011 (3)
  • July 2011 (15)

Blog at WordPress.com.

  • Follow Following
    • Mai Omar Desouki
    • Join 867 other followers
    • Already have a WordPress.com account? Log in now.
    • Mai Omar Desouki
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
%d bloggers like this: