views:

42

answers:

1

Here is what I have:

Dim cmsManager As New Telerik.Cms.CmsManager()
Dim currentNode As Telerik.Cms.Web.CmsSiteMapNode = CType(SiteMap.CurrentNode, Telerik.Cms.Web.CmsSiteMapNode)
Dim currentPage As Telerik.Cms.ICmsPage = currentNode.GetCmsPage()
Dim currentPageId As Guid = currentPage.ID
Dim pageFromDb As Telerik.Cms.IPage = cmsManager.GetPage(currentPageId)

Me.LastUpdateDate = pageFromDb.DateModified

Unfortunately .DateModified returns the last time that a page was edited instead of when it was last published. I've been looking through the documentation but I haven't been able to find any corresponding properties.

+1  A: 

Here's the code I'm using now, it seems to be getting the correct date on Publish:

Dim cmsManager As New Telerik.Cms.CmsManager()
Dim currentPageId As New Guid(SiteMap.CurrentNode.Key)
Dim pageFromDb As Telerik.Cms.IPage = cmsManager.GetPage(currentPageId, False)
Dim staged As Telerik.Cms.IStagedPage = pageFromDb.GetVersion(pageFromDb.Version)

Me.LastUpdateDate = staged.DateModified

I'm not sure if there's a better way to do it though.

travis