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
Hi Avishnyakov,
Thanks for your reply.
Yes it does makes sense .. and I wanted all people to know your reply, if you don’t mind, I posted about it in my blogĀ http://maiomardesouki.com/2013/08/22/sharepoint-2013-csom-in-managed-code-where-is-the-current-in-the-client-context/Ā and other 6 blogs I am author in and shared this discussion link in case anyone want to reply.
Hopefully everyone get the benefit as I did.
Regards,
Mai Omar Desouki