You can programmatically determine if the SPPublishingPage you're dealing with is in a published state by retrieving the SPFileLevel of the page's corresponding SPFile:
if (page.ListItem.File.Level == SPFileLevel.Published) …
You can also access this through the PublishingPage.ListItem.Level property.
The same SPFileLevel enumeration will also indicate if the page is in draft mode (checked in but not published) or checked out but in my experience this property will return SPFileLevel.Published or SPFileLevel.Draft more often than not.
To determine whether the page is checked out, use the SPFile.CheckOutStatus property in WSS 3.0 or the SPFile.CheckOutType property in SP2010. Any value other than None means the page is checked out.
Hi, How to check if page is published in Javascript client object model? Thanks
ReplyDelete