Questions tagged [sharepoint-object-model]

SharePoint Object Model exposes SharePoint API. This is broken down into the "original" Object Model and the newer (since SP2010) Client Object Model.

SharePoint Object Model exposes SharePoint API when direct access to the Content Database is allowed.

This is different than the SharePoint Client Object Model - for that, see "sharepoint-clientobject".

49 questions
20
votes
6 answers

How to detect page refresh in .net

I have a Button_click event. While refreshing the page the previous Postback event is triggering again. How do I identify the page refresh event to prevent the Postback action? I tried the below code to solve it. Actually, I am adding a visual…
Srikanth
  • 683
  • 3
  • 16
  • 23
7
votes
1 answer

Configuring a sharepoint site subscriptions user account directory path with the object model

I'm working on multi tenant provisioning in sharepoint and I'm having trouble figuring out if you can set the user account directory path for a site subscription using the sharepoint object model. I know this can be done through powershell with the…
5
votes
1 answer

Programmatically enumerating Web Part Zones of a Publishing Page Layout

I have a situation where a class I have is passed a PublishingPage instance and I want to enumerate any and all web part zones that are used in the Layout Page for this page. This is proving tough. PublishingPage has a property called Layout, which…
5
votes
2 answers

Authenticating client with office 365/SharePoint online

I have a client application which consumes SharePoint web service (list.asmx). Recently SharePoint is migrated to SharePoint Online. Now authentication is failing. This might be because authentication mechanism is different in SharePoint Online. I…
5
votes
1 answer

How to impersonate Farm Administrator in server object model?

We are using SharePoint Foundation 2010. We are creating content database and site collection using server object model. We have more than 1000 users in SharePoint. As content database and site collection creation are administartive task, only farm…
5
votes
3 answers

how can I Obtain ClientContext in office 365 with fixed credentials (do not prompt user)

I am prototyping a tool that runs every few minutes and goes off to an office 365 site and to retrieve and then process information. At the moment I have started with the MSDN guide "Remote Authentication in SharePoint Online Using Claims-Based…
4
votes
1 answer

How do I get the email address of the author of a SharePoint list item?

As title says, I have access to the current listitem - and it's easy enough to get the author/created by name - but how do I retrieve the e-mail address of the author in C# from the object model? Thanks.
user1017882
3
votes
2 answers

Add column to SharePoint Online 2013 list via Powershell v3

Can anybody tell me how to do this? None of the examples I have found seem to work. My site is https://blah.sharepoint.com/technology and my list is called 'pfa'. I want to add some text columns. I DO have connectivity with SharePoint Online via my…
2
votes
4 answers

Sharepoint 2010 - make Title, Description and Keyword fields as required fields in Picture Library using server-object-model

I'm creating a Sharepoint feature, this feature has an event receiver associated to it. In the event receiver, I'm creating a Document Library and Picture Library using server-side object model. I'm also adding new custom columns (around 80) to…
2
votes
1 answer

SharePoint API for both 2016 On-Premise and Online

Hello fellow colleagues, I am starting to write a SharePoint Adapter which should work on: support SharePoint 2016 On-Premise/ Online and 365. So far I've understood that Office365 uses Online so it narrows down the supported version to: SharePoint…
2
votes
2 answers

Need Sharepoint like modal pop-up window

I need to show Sharepoint 2010 like pop-up window when clicked on a link in grid view. Once the modal pop-up displayed and user selected the Save button data base should be updated with given values in pop-up. How can I get this. Any Idea. As of now…
Srikanth
  • 683
  • 3
  • 16
  • 23
1
vote
1 answer

Can't retrieve metadata from a document in SharePoint inside a folder in javascript client object model

The below code is working fine for me when the document that contains the meta data isn't inside a folder. As soon as the document is placed into a folder in the document library it stops working after while (enumerator.moveNext()) { I've placed…
1
vote
1 answer

How to get all sites and sub-sites in SharePoint and access an image library/list?

How to get all sites and sub-sites in SharePoint and access an image library/list? I am looking forward to achieve this via the SharePoint object model. Inside each site or subsite I want to access an image library/list, After getting to this list,…
code master
  • 2,026
  • 5
  • 30
  • 49
1
vote
2 answers

How to get all of the deactivated Features in the farm that could be activated for the specific web using Sharepoint Server Object Model?

I need to get list of SPFeatureDefinitions like in ManageFeatures.aspx page. Probably it should be smth like this: ... using (SPWeb web = spSite.OpenWeb()) foreach (var spfeature in SPFarm.Local.FeatureDefinitions) { result.Add(spfeature); …
1
vote
2 answers

Updating SPFile properties using SPFile.Update()

I'm trying to update SPFile properties. Here is my code: using (SPSite oSite = new SPSite(sFileURL)) { using (SPWeb oWeb = oSite.OpenWeb()) { oWeb.AllowUnsafeUpdates =…
Guid2015
  • 57
  • 11
1
2 3 4