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% [?]
edinburgh shemales is great web place for free chat contacts in UK
Really good post!! Many thanks!
Great article! Are you planning on publishing an article related to car detailing in Lakeland, FL?
Great Article. Really very useful.
Find fine ladies from EU for chat and other kind of casual contacts at sex in schleswig holstein
Great work. Thanks for the lesson.
https://www.paintersinsantaclarita.com/
Shemale Montpellier is the best for your own casual chat pleasure
Sex Sachsen hat für Sie gesorgt. Es ist im Grunde die erste Anlaufstelle für alle, die in die Welt der Partnersuche einsteigen. Wenn Sie beim Online-Dating auf Nummer sicher gehen wollen, müssen Sie dort swipen, wo alle swipen.
Sex BW ist eine erotische Website, wo Sie mit all Ihren aufregenden, frechen und geilen Fantasien gehen können. Ob Sie neue Sexkontakte für sehr perverse Gedanken oder jemanden für eine “normale” geile Nacht suchen, Sie werden hier alles finden und alles dazwischen. Hier finden die heißesten Gespräche statt!
Transen ist eine relativ neue Dating-App für Menschen mit Trans-Erfahrung und solche, die sich mit ihnen treffen möchten. Die Profile sind einfach und leicht zu bedienen
Excellent post! Thank you! https://www.premierpoolfenceorlando.com/
I believe this post is very useful. Thank you for sharing this with us! Handyman Pros of Lethbridge
I find this so informative. Thanks for sharing this. http://www.appliancerepairsherwood.com
Hey! this is a very interesting post, I liked it…
Tree Services Richmond VA
Nice post! Thanks for taking the time in sharing this great article in here.
Plastic Surgery Mesa
Nice approach to the problem. Our licensed contractor would probably follow your tips. Thanks!
“Thank you very much for this wonderful topic!
Landscaping Red Deer AB
‘”
“very informative article!!! thank you so much!
Concrete In Red Deer“
Thank you for sharing your experience and the alternative approach you implemented. It’s always inspiring to see how developers overcome challenges and find creative solutions. Keep up the great work! http://www.paramountsealcoating.com/naples-asphalt-sealcoating-company
That’s great! It’s always satisfying to track down a problem and find a solution. Search Engine Optimization
Do you think publishing a web can help me with my home remodeling business? Let me know. More power!
“Thank you for this amazing blog!
Plastic Surgery“