Hi SharePoint Community,
My question either simple or wired but it is not difficult; there is nothing difficult about it.
Basically I was investigating the APIs in SharePoint 2013.. whats there and what not..
Just at the start of utilizing CSOM and as anyone I am trying to call property “Current” for web application instead of writing the Web Full URL .. which is a v basic thing.
I am looking here http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.clientcontext.current.aspx and look at the Namespace: Microsoft.SharePoint.Client but the DLL is for Silverlight!!! Assembly: Microsoft.SharePoint.Client.Silverlight (in Microsoft.SharePoint.Client.Silverlight.dll)
Does this means only for Silverlight web parts or what exactly?
In JSOM JavaScript Object model, there is a “Current” function: SP.ClientContext.get_current()
While and of course everyone knows this [assuming so] in the .NET Server API it exists http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spcontext.aspx
SPList oListCur = SPContext.Current.List; SPWeb oWeb = SPContext.Current.Web; SPSite oSite = SPContext.Current.Site; SPWebApplication oWebApplicationCur = SPContext.Current.Site.WebApplication; My question is ... is "Current" property really doesn't exists in CSOM in managed code!? Regards, Mai Omar Desouki
Hello Mai,
Sure, no worries. My pleasure.
You may also consider following me via twitter/blog 🙂