sharepoint-2007

How to get list of all document libraries from sharepoint site programatically

家住魔仙堡 提交于 2019-12-03 17:12:43
I am using below code which gives me both list & document library; but I am trying to get list of only document libraries. Please help me how to differentiate list & document library programatically using(SPSite oSite = new SPSite("https://server/site")) { using (SPWeb oWeb = oSite.OpenWeb()) { SPListCollection oLists = oWeb.Lists; foreach (SPList olist in oLists) { Response.Write(olist.Title+"<br>"); } } } Jignesh Rajput See this Post Try this ways : using(SPSite oSite = new SPSite("https://server/site")) { using (SPWeb oWeb = oSite.OpenWeb()) { SPListCollection docLibraryColl = oWeb

SPWeb.Webs, Site vs SubSite

狂风中的少年 提交于 2019-12-03 16:57:58
I am confused between SPSite , SiteCollection , and SPWeb ? So my understanding is this pseudo code: http://My_server >>> TOP Level SIte or SPWEbApplication http://My_server/My_site >>>> Site Collection or SPSite Now a site under SPSite that will be referenced through SPWeb . So what are we getting when using SPWeb.Webs ? What is a Subsite? Test code: SPWeb mySite = SPContext.Current.Web; SPWebCollection sites = mySite.Webs; foreach (SPWeb subSite in sites) { Response.Write(SPEncode.HtmlEncode(subSite.Title) + "<BR>"); } Henry C The top level site collection SPSite is a container in which you

Where can I find good programming resources for SharePoint? [closed]

梦想的初衷 提交于 2019-12-03 14:55:30
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I have been trying to find a book or web reference that gives me good understanding on how to build, test, and deploy ASP.NET pages, controls, and web parts to a SharePoint web site. All I have found so far is either draggy-droppy stuff or administration stuff. Is SharePoint really flexible with ASP.NET when is

How to dynamically switch PageLayout and MasterPage of SharePoint Publishing page?

此生再无相见时 提交于 2019-12-02 10:19:17
问题 To improve both the editing and displaying experience of SharePoint WCM Publishing pages I would like to be able to switch to a special set of Masterpage/PageLayout when in edit mode. So in /_catalogs/masterpage I want to have: MyMasterpage.master - masterpage for display mode MyMasterpage-edit.master - masterpage for edit mode, only use if available MyPageLayout.aspx - pagelayout for display mode MyPageLayout-edit.aspx - pagelayout for edit mode, only use if available When I create a new

How to dynamically switch PageLayout and MasterPage of SharePoint Publishing page?

两盒软妹~` 提交于 2019-12-02 07:38:42
To improve both the editing and displaying experience of SharePoint WCM Publishing pages I would like to be able to switch to a special set of Masterpage/PageLayout when in edit mode. So in /_catalogs/masterpage I want to have: MyMasterpage.master - masterpage for display mode MyMasterpage-edit.master - masterpage for edit mode, only use if available MyPageLayout.aspx - pagelayout for display mode MyPageLayout-edit.aspx - pagelayout for edit mode, only use if available When I create a new publishing page in the Pages library, I select the MyPageLayout page layout. When rendering the page I

Problem mixing OOTB SPD WFAs and Custom WFAs

百般思念 提交于 2019-12-02 07:09:20
问题 I'm using MOSS (SharePoint 2007 Enterprise), 32-bit, SP2. I've been noticing some odd problems with Custom Workflow Activities which I've developed and am using in SharePoint Designer (SPD) workflows. These actions seem to work correctly, but don't "play nice" with the rest of the workflow (specifically, the root issue was posted at: Timing concerns with Custom WF Activity changing permissions , since that hasn't gotten any responses I've been digging deeper...) To help pin down the problem,

Query to get all items in a list including items in the sub folders in SharePoint

浪尽此生 提交于 2019-12-02 04:33:54
I have a document library list. I created folders in that list and uploaded some files to those sub folders. How to get all these files which are in sub-folders in that document library list using SPQuery ? If you want to query all folders and sub folders of a list or document library, you have to define extra query options. If you are working with the object model you have to set the ViewAttributes property of the SPQuery object as follows: qry.ViewAttributes = "Scope='Recursive'"; 来源: https://stackoverflow.com/questions/4192873/query-to-get-all-items-in-a-list-including-items-in-the-sub

solution for RPC_E_ATTEMPTED_MULTITHREAD error caused by SPRequestContext caching SPSites?

折月煮酒 提交于 2019-12-02 04:15:47
I'm developing a solution for SharePoint 2007, and I'm using SPSecurity.RunWithElevatedPrivileges a lot, passing in UserToken of the SystemAccount. After reading http://hristopavlov.wordpress.com/2009/01/19/understanding-sharepoint-sprequest/ I finally began to understand why I get these System.Runtime.InteropServices.COMException (0x80010102): Attempted to make calls on more than one thread in single threaded mode. (Exception from HRESULT: 0x80010102 (RPC_E_ATTEMPTED_MULTITHREAD)) errors, but there seems to be no solution - "known issue in the product" The article is more then a year old. I

Problem mixing OOTB SPD WFAs and Custom WFAs

北战南征 提交于 2019-12-02 03:53:25
I'm using MOSS (SharePoint 2007 Enterprise), 32-bit, SP2. I've been noticing some odd problems with Custom Workflow Activities which I've developed and am using in SharePoint Designer (SPD) workflows. These actions seem to work correctly, but don't "play nice" with the rest of the workflow (specifically, the root issue was posted at: Timing concerns with Custom WF Activity changing permissions , since that hasn't gotten any responses I've been digging deeper...) To help pin down the problem, I've developed a very simple test, which I will outline in detail below, and am noticing even more odd

Open a web folder (Sharepoint 2007)through openFileDialog

冷暖自知 提交于 2019-12-02 03:42:44
I have the following snippet of code written in C#: openFileDialog1.InitialDirectory = "\\\\fwm-storage\\users\\" + curUser + "\\My Documents\\My Pictures"; openFileDialog1.Filter = "All Files (*.*)|*.*|Images (*.jpg)|*.jpg"; openFileDialog1.FilterIndex = 2; // blah, blah, blah Which works great and all, but, I want to be able to add/change the ability to have the openFileDialog.InitialDirectory be a web folder on our SharePoint server. Say, for example: "http:\intranet\company\division\photos" Anyone have any ideas as to how I can do this. I have exhausted my morning looking for an answer and