Alternative for PublishingWeb.IsPublishingWeb
Just today I wondered why something was not working with a specific custom code and was able to track the problem down by debugging to using PublishingWeb.IsPublishingWeb -method to a web in another site collection with read-permissions. The error message was somewhat puzzling, something like:
0×80070002
at Microsoft.SharePoint.Library.SPRequestInternalClass.GetWebUrl(Guid gWebId, String bstrSiteUrl)…..
Then I remembered that my colleaque Tomi Tavela had resolved figuring out whether the SPWeb object is a publishing web or not in an anonymous scenario in this post Anonymous Access and Publishing Web Pages List.
So what I did following Tomi’s approach was to implement an alternative for the awkwardly behaving PublishingWeb.IsPublishingWeb -method by creating a method which checks if the site (SPWeb) has got a Pages-library.
{
if (web == null || !web.Exists) return false;
return web.Lists.TryGetList(SPUtility.GetLocalizedString
("$Resources:List_Pages_UrlName", "cmscore", web.Language))
!= null;
}
Popularity: 1% [?]
This article will discuss lifestyle in detail. Betty Anne Waters Net Worth
This article explains the lifestyle in detail. https://thepokepoint.com/corrie-bird-career-and-personal-life/
Great Post: corrie bird
This article provides a detailed explanation of the lifestyle. https://rock-heardle.com/lil-mabu-age-bio-career-parents-family-and-personal-achievements/
This article will tell you more about this Ashlyn Peaks Age
This article will let you know greater approximately this Tamara Gilmer
This is the really nice post thx: Constantine Yankoglu
Wow, that’s incredible: Holly Bankemper
Awesome post: https://ballsymagazine.com/
This is the really nice post thx: Kaynette Williams
Excellent post: Mira Murati Net Worth